More drawing tool woes: no mouseDown or mouseUp sent?

MisterX b.xavier at internet.lu
Sat Sep 10 06:06:56 EDT 2005


this works...

i made a palette stack whose card script is frontscripted.

all mouse events work... in pointer mode in the normal stack where i would
edit the controls.

the only danger is if you dont check where clicking is legal and where it's
not (if not in the editor stack, pass the events), or you'll be in
click-trouble... ;) Keep the front script open just in case...

That's is how resizeNO2 works to overide teh way Rev resizes controls so you
can have proportional or square shapes and or horizontal, vertical lines... 

The script is open
http://monsieurx.com/modules.php?name=Downloads&d_op=getit&lid=78

cheers
Xavier


> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Dave Cragg
> Sent: Saturday, September 10, 2005 11:45
> To: How to use Revolution
> Subject: Re: More drawing tool woes: no mouseDown or mouseUp sent?
> 
> 
> On 10 Sep 2005, at 08:37, Richard Gaskin wrote:
> 
> > 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?
> 
> Is there any way of using a "dummy object" (perhaps off 
> screen) that you select by script when you set the appearance 
> of the non- selectable objects. Then when you click off the 
> control, you could trap for a selectedObjectChanged message 
> as the "dummy object" is unselected. (I haven't thought this 
> through at all. No doubt it's full of holes.)
> 
> Cheers
> Dave
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage 
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list