mouseDown and within
Thomas McGrath III
3mcgrath at adelphia.net
Sat Apr 23 12:22:58 EDT 2005
Hey Eric and others,
HELP, I am so damn close.
With the adjusted script below I can pretend to trap a mouseUp even
though the actual mouseUp handler in my script doesn't receive it.
(This is because of the mouseDown issue "bug", sort of, at least to me
it is!). Any way the check if the mouse is up works over the new
control at present and I get to hear the "mouse up" which will be
replaced later with my necessary code.
The problem now comes down to one thing.
1. The highlights don't always un-highlight and seems to be a time
related thing. I tried 50 ms, 10 ms, 1 ms, and 5 ms - If I move the
mouse around in the down state I end up with a trail of highlighted
buttons left behind. Not all of them and some times it seems like the
same ones but I can't prove that.
on mouseDown
global theKeys, thecheck
if the short name of the target is among the lines of theKeys then --
if "button" is in the target then
CheckOtherButtons -- Æ
end if
end mouseDown
---------------------------------------
on CheckOtherButtons
global theKeys, thecheck
if the mouse is up then
set the hilite of btn thecheck to false
revspeak "mouse up" && thecheck
put "" into thecheck
exit CheckOtherButtons
end if
if thecheck is not empty then
set the hilite of btn thecheck to false
end if
repeat for each line i in theKeys --with i = 1 to the number of btns
if the mouseLoc is within the rect of btn i then
set the hilite of btn i to true
put i into thecheck
cPreviewKey i
end if
end repeat
send "CheckOtherButtons" to me in 5 milliseconds -- 50
end CheckOtherButtons
More information about the use-livecode
mailing list