mouseEnter/mouseLeave Problem

Lynch, Jonathan bnz2 at cdc.gov
Wed Apr 13 09:55:05 EDT 2005


You might be able to rework this by catching the mousemove message in
the card script or the stack script. Something like the following might
work (untested, so it will prolly need some tweaking)

On mousemove
   Global gBluelist
   If word 1 of the long name of the mousecontrol = "graphic" then
      Put the short name of the mousecontrol into tGraphic
      If gBluelist = tGraphic then exit mousemove
	If gBluelist <> empty then 
        set the foregroundcolor of graphic gBluelist to black
        Put empty into gBluelist
        Set the foregroundcolor of graphic tGraphic to blue
        Put tGraphic into gBluelist
      Else
	  Set the foregroundcolor of graphic tGraphic to blue
        Put tGraphic into gBluelist
	End if
   Else
      If gBluelist <> empty then
        set the foregroundcolor of graphic gBluelist to black
        Put empty into gBluelist
      End if
   End if
End mousemove

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of David
Burgun
Sent: Wednesday, April 13, 2005 7:08 AM
To: How to use Revolution
Subject: mouseEnter/mouseLeave Problem

Hi,

I have a script on a graphic rectangle object that does the following:

on mouseEnter
set foregroundColor of me to blue
pass mouseEnter
end mouseEnter

on mouseLeave
set foregroundColor of me to black
pass mouseLeave
end mouseLeave

on mouseDown
set the layer of me to top
end mouseDown

on mouseStillDown
-- Move the object via the mouse, sets a new rect for the object 
based on mouse movement
end mouseStillDown

This works fine most of the time, however if I have two rectangle 
that overlap each other on the display, then when I move the mouse 
from one to the other, the mouseLeave handler does not seem to get 
called ***IF* I have moused-down in one of these objects. For 
instance:

Both rectangles are set to black
I move the mouse into into Rectangle A which is in front of Rectangle 
B. Everything works ok. The rectangles change from black to blue as 
expected. However if I do this:

Both rectangles are set to black
Move into Rectangle A - Changes to Blue
Move into Rectangle B - A changes to Black and B changes to Blue (but 
B says behind A)
MouseDown in Rectangle B - B moves in in front of A
MouseUp in Rectangle B - (mouseStillDown may have been called)
(Now Rectangle B is in Front and set to Blue, rectangle A is black)
Move into Rectangle A - B does NOT go to black, the mouseLeave 
handler is NOT called, A gets changed to Blue, so both are set to 
Blue!!!

Any ideas why mouseLeave is not being called? Seems to be after a 
MouseDown/Up sequence?

Thanks a lot
Dave


_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list