How to set a field in place with dragenter and a singleclick?

Eric Chatonet eric.chatonet at sosmartsoftware.com
Mon Dec 19 04:02:48 EST 2005


Hi William,

This should do the trick you want:

local lAllowDrag
---------------------------------
on mouseDown
   set cursor to 28
   lock cursor
   set the layer of me to 100
   set the dragdata["text"] to the short name of the target
   put the (mouseH - the left of me) & comma & (the mouseV - the top  
of me) into lAllowDrag
end mouseDown
---------------------------------
on dragMove x,y
   if lAllowDrag is empty then exit dragMove
   set the topLeft of me to (x - item 1 of lAllowDrag) & comma & (y -  
item 2 of lAllowDrag)
   if the mouse is up then
     put empty into lAllowDrag
     unlock cursor
   end if
end dragMove
---------------------------------
on mouseEnter
   put empty into lAllowDrag
end mouseEnter


Best Regards from Paris,
Eric Chatonet
------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/


Le 19 déc. 05 à 07:39, William de Smet a écrit :

> When I put the "grab" command as the last thing the feld is going  
> nowhere (I can't grab it).
> The script works for me as well but want I want is a single  
> mouseclick to unlock the cursor.
> With this script I need to doubleclick tomake it happen. And that's  
> to difficult for the children I work with.
>
> So can anyone help? Please.. : - )




More information about the use-livecode mailing list