Unlocked field receives the mouseUp message

Jim Hurley jhurley0305 at sbcglobal.net
Mon Nov 28 12:07:10 EST 2011


I have been trying to find a way  for the user to change a text field from unlocked to locked and back without leaving the field, just using mouse clicks.

I have found (stumbled on) a way that appears altogether illegitimate.

If the field is unlocked I can type into the field as expected. If I click in the field nothing happens, again as expected. 

BUT if I right click (control click) in the unlocked field the field receives both a mouseDown and a mouseUP message and I now have a way to change the field from unlocked to locked  even when the field is unlocked and supposedly receiving key strokes but not mouse clicks. (See script below.)

Is there some orthodoxy by which I can under stand this? 

Jim Hurley

on mouseUP tNum
   put the locktext of field id 1003 &cr after msg box
   if tNum = 3 then set the locktext of field id 1003  to not the locktext of field id 1003 -- returns false & cr & true
   put the locktext of field id 1003 &cr after msg box
end mouseUP

If tNum = 3 and the field is unlocked, the message box shows: 

false
true



More information about the Use-livecode mailing list