Inappropriate Interface Behaviour during mouseDown

Scott Raney raney at metacard.com
Sun Nov 17 16:29:01 EST 2002


> The problem in implementing this behaviour in Revolution is that
> while the mouse is down, Revolution does NOT send
> mouseEnter/mouseLeave messages to objects. The 'mouseRelease'
> message exists, as far as I can see, precisely because while the
> mouse is down, if a user moves AWAY from the clickable area, this
> movement is not detected until AFTER the user has RELEASED the
> mouse. This makes for some incongruent/inconsistent behaviour. If a
> user presses down a button, and then moves away, the button should
> not remain highlighted once the cursor moves beyond the button's
> boundaries. By remaining highlighted, the button is telling the user
> that it is STILL armed and about to trigger an action, which is not
> correct. The reverse (pressing down outside the button and then
> moving onto it) is also true. It SHOULD trigger an action, because
> the user is releasing a button INSIDE the clickable area, but that
> does not happen in Revolution.

What you're talking about is called "tracking" in GUI jargon.  Buttons
with automatic behavior do tracking automatically, and you can even
have them change icons automatically (see armedIcon, hilitedIcon,
etc.).  If the automatic behavior doesn't do what you need, then
you'll have to handle the tracking yourself using the mouseMove
message (e.g, "if x, y is within the rect of me then ...")

Secondly, when a mouse button is pressed down in a control, that
control gets a "grab" on the mouse such that all mouse messages go to
that object until the mouse button is released.  This is a core
behavior of all GUI systems, and is why all mouseMove messages go to
that control and why mouseEnter/mouseLeave messages are not sent: From
the perspective of that control it still "owns" the mouse and so the
mouse can never "leave".  This is a feature, not a bug.
  Regards,
    Scott

********************************************************
Scott Raney  raney at metacard.com  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...




More information about the Use-livecode mailing list