More drawing tool woes: no mouseDown or mouseUp sent?
ambassador at fourthworld.com
Sat Sep 10 02:37:24 CDT 2005
I'm making a specialized drawing tool, and I need to know when the mouse
is clicked outside of any control while the pointer tool is active --
here's my setup:
The card has a group which is used as the drawing region. I also have
another group which is used for tools, and the cantSelect of those tool
buttons is set to true in order to have them behave like the browse tool
when the pointer tool is active.
Some of the objects in my drawing region group are selectable as normal,
and others have their cantSelect set to true as they're mostly managed
by script in response to things the user does with the selectable objects.
When the user clicks on one of these non-selectable objects I change its
appearance to indicate that it's selected.
Now here's the challenge: When the user clicks off of any control I
need notification so I can change the appearance of those objects.
We get this behavior for free with normally selectable objects: you
click on it and it's selected, you click off of it and it's deselected.
But in order to manage my non-selectable objects, I need to know when
the mouse is clicked anywhere outside of a control.
Apparently the mouseDown and mouseUp messages are not sent when the
pointer tool is active unless the user clicks with button 3; the normal
button 1 click never sends the message to the card. Unlike SuperCard,
we have no pointerDown or pointerUp message which would make this a snap.
I've tried placing a graphic object at the back of my group to trap
messages like that, but if I leave it with the cantSelect off it's
selectable, and if I turn on the cantSelect then dragging on it gives
the browse tool behavior rather than the pointer tool behavior of the
selection marquee. Suppporting the normal behavior of marquee selection
is important and I don't want to sacrifice it just to work around the
lack of mouseDown or mouseUp.
Any other suggestions for identifying when the user clicks outside of
any control on a card while the pointer tool is active?
This sort of thing is a 15-minute job in SuperCard, now on my third
month in Rev....
Fourth World Media Corporation
Rev tools and more: http://www.fourthworld.com/rev
More information about the use-livecode