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

William de Smet wdesmet at wanadoo.nl
Mon Dec 19 15:44:27 EST 2005


Hi Jim,

On both your questions: yes.
Imagine 5 fields or images that need to be put in the right place.
The user needs to know when an item is 'sticky' because visible  
support  makes it easier.

greetings,

William


Op 19-dec-2005, om 19:29 heeft Jim Ault het volgende geschreven:

> Quick question, William...
> Are there any other items you want to be 'sticky'?
> Do you need the cursor to change to show the user that he is in  
> 'sticky'
> mode?
>
> Jim Ault
> Las Vegas
>
> On 12/19/05 10:09 AM, "William de Smet" <wdesmet at wanadoo.nl> wrote:
>> Hi Eric,
>> Thanks for your reply,
>> I need something like this but not exactly what you suggested.
>> When I use your script you need to put your mouse down to move the
>> field but when you release the mouse the field stays in place (you
>> need to hold down the mousebutton to move the field!).
>>
>> I want to leftclick the mouse once  and be able to move the field
>> around (the field sticks to the mousepointer).
>> With the next leftclick on the mouse the field will be put in place.
>>
>> I hope you know what I mean ( my English isn't that great!).
>> William
>>
>> Op 19-dec-2005, om 10:02 heeft Eric Chatonet het volgende geschreven:
>>
>>> 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
>>>
>>>
>>> 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.. : - )
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the Use-livecode mailing list