[Gambas-user] Drag & Drop Question?

Benoit Minisini gambas at ...1...
Sun Aug 21 17:30:13 CEST 2005


On Sunday 21 August 2005 09:35, Steve Starr wrote:
> I am trying to move a button like so.
>
> <---Code--->
>
> PUBLIC SUB Button1_MouseMove()
>
> Button1.X = Mouse.X
> Button1.Y = Mouse.Y
>
> END
>
> <---The Question--->
> But the button widget jumps around when i drag it how could i keep the
> button that i want to drag from jumping around?

Mouse.X/Y are relative to the top corner of the button!

You must memorize the absolute coordinates of the mouse in MousePress event, 
and move the button in MouseMov by using the difference between the current 
absolute Mouse cursor position and the memorized one.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list