[Gambas-user] How to generate a new frame or pic box when a button is pressed

Fabien Bodard gambas.fr at ...626...
Mon Jan 11 09:41:21 CET 2010


PRIVATE $MX AS Integer
PRIVATE $MY AS Integer

PUBLIC SUB Form_MouseDown()

  $MX = Mouse.ScreenX - ME.X
  $MY = Mouse.ScreenY - ME.Y

END

PUBLIC SUB Form_MouseMove()

  ME.Move(Mouse.ScreenX - $MX, Mouse.ScreenY - $MY)

END


It's like that :)

2010/1/11 Fiddler63 <mx4eva at ...626...>:
>
> Fab, thanks for that.
> I got the form to show fine but I'm a bit confused about the movement with
> the mouse.
> Tell me if I'm on the right track here:
>
> X,Y of the mouse is within X,Y of the object to be moved
> and while MouseDown, move object to current Mouse X,Y coordinates.
>
> Do I handle each of the events as separate sub routines ?
>
> I mainly struggle because I come from a 8-bit chip background where you need
> to know absolutely everything.
>
> Cheers
> Kim
>
>
>
>
> Fabien Bodard-4 wrote:
>>
>> in fact you need to load a new form, set it's border to none, set it's
>> size to the picture size, set it's picture to the picture, and then
>> manage the movement with mouseDown, mouseUp and MouseMove events.
>>
>>
>> dim hForm as new Form
>> hForm.Resize(hPic.W, hPic.H)
>> hForm.Picture = hPic
>> hForm.Border = Border.None
>>
>>
>>
>>
>> 2010/1/10 k p <mx4eva at ...626...>:
>>> I got a button on a form and when I click the button I need the program
>>> to
>>> load a new frame/picture.
>>> Also I would like to be able to move the new frame/pic around on the
>>> screen
>>> to suit.
>>>
>>> How do I go about the above ?
>>>
>>> Cheers
>>>
>>> kim
>>> ------------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Verizon Developer Community
>>> Take advantage of Verizon's best-in-class app development support
>>> A streamlined, 14 day to market process makes app distribution fast and
>>> easy
>>> Join now and get one step closer to millions of Verizon customers
>>> http://p.sf.net/sfu/verizon-dev2dev
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>> ------------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Verizon Developer Community
>> Take advantage of Verizon's best-in-class app development support
>> A streamlined, 14 day to market process makes app distribution fast and
>> easy
>> Join now and get one step closer to millions of Verizon customers
>> http://p.sf.net/sfu/verizon-dev2dev
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>
>
> --
> View this message in context: http://old.nabble.com/How-to-generate-a-new-frame-or-pic-box-when-a-button-is-pressed-tp27095779p27106569.html
> Sent from the gambas-user mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list