Passing mouse clicks up the object heirarchy

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Passing mouse clicks up the object heirarchy

Post by FourthWorld » Fri Jul 10, 2020 5:11 pm

If you have a message you want ignored in any object, the object's script can trap messages and take no action and not pass them.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Passing mouse clicks up the object heirarchy

Post by jacque » Fri Jul 10, 2020 5:18 pm

richmond62 wrote:
Fri Jul 10, 2020 4:18 pm
dunbarx wrote:
Fri Jul 10, 2020 4:00 pm
Perhaps Panos slightly misused "blocks" when he meant "ignores"?

Craig
I hope so.
I'm sure that's what he meant, or would have meant if he'd thought a moment. I understand his point of view, new users would likely be confused if they checked a disabled box and nothing visually changed. The behavior of images isn't like the disabled behavior of other controls either.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Passing mouse clicks up the object heirarchy

Post by bogs » Fri Jul 10, 2020 5:27 pm

Purple, the answer is always purple...except when it is green....
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Passing mouse clicks up the object heirarchy

Post by richmond62 » Fri Jul 10, 2020 7:09 pm

All my tomato plants are grue:

https://youtu.be/1rUCyg4Ppso

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Passing mouse clicks up the object heirarchy

Post by dunbarx » Sat Jul 11, 2020 3:22 am

Richard
If you have a message you want ignored in any object, the object's script can trap messages and take no action and not pass them
Um, no. The trapping, taking no action and not passing a message is not the same as ignoring it. A disabled control ignores messages. A control with:
on mouseUp
end mouseUp
buries messages.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Passing mouse clicks up the object heirarchy

Post by FourthWorld » Sat Jul 11, 2020 4:12 am

dunbarx wrote:
Sat Jul 11, 2020 3:22 am
Richard
If you have a message you want ignored in any object, the object's script can trap messages and take no action and not pass them
Um, no. The trapping, taking no action and not passing a message is not the same as ignoring it. A disabled control ignores messages. A control with:
on mouseUp
end mouseUp
buries messages.
Good linguistic analysis.

Same result.

I'll try to choose my words more carefully.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Passing mouse clicks up the object heirarchy

Post by SparkOut » Sat Jul 11, 2020 9:12 am

Just to stir up more mud in the water (sorry turtles), I seem to remember a discussion that mentioned sort of "queuing" messages, and formerly disabled controls responding to the queued messages on being re-enabled after they had been sent.

But that seemed to be due to a "wait" being in effect, in essence the message was attached to the turtle but the turtle was not allowed into the water until after the wait period was over, meaning that by the time the turtle got to the trap, it was re-enabled again.
viewtopic.php?p=150017#p150017

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 366
Joined: Mon Jun 10, 2013 1:32 pm

Re: Passing mouse clicks up the object heirarchy

Post by Lagi Pittas » Sat Jul 11, 2020 2:28 pm

FourthWorld wrote:
Thu Jul 09, 2020 6:53 pm
I belong to no political party, hold the same respect for all churches, and even treat left-handed people as I would right-handed.

But on this most important matter I take my stand: messages fall downward.

Yes, this is the hill I'm prepared to die on. :)

I stand with Terry and Richard on the Hill - but I was going to use Parent & Child and then I remembered we might not be able to use that like Master & Slave when talking about computers for crying out loud)


cogito ergo sum

I think therefore I am ... I'm Pink therefore I'm Spam (must brush up on my Latin).

Translated with a Latin to Hungarian dictionary and then Hungarian to to English dictionary - I didn't have a Latin to English dictionary.

(If you are not into Monty Python well .... https://www.youtube.com/watch?v=YSlHnSzFLBw )

Lagi

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Passing mouse clicks up the object heirarchy

Post by dunbarx » Sat Jul 11, 2020 3:17 pm

We will soon tire of this. We always do. But generally there is value and fun along the way.

But,
Good linguistic analysis.

Same result.
Thank you.

Nope. If you click on an object that is disabled, the message likely passes into the card. If you click on an object with a handler as above, the message is stopped, frisked and killed.

It is very different; it therefore matters. It is also likely a matter of words, not ideas, at least in the most recent part of this thread.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Passing mouse clicks up the object heirarchy

Post by richmond62 » Sat Jul 11, 2020 4:28 pm

I remembered we might not be able to use that like Master & Slave when talking about computers
I am having trouble working out if I am a slave to my computers, or my computers are my slaves.

Oh, well, I think I'll just go and park some cars,
while you try and spice up the, frankly, slightly bland semantic soup.
-
Marvin.jpg
Marvin.jpg (14.5 KiB) Viewed 6983 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Passing mouse clicks up the object heirarchy

Post by FourthWorld » Sat Jul 11, 2020 6:23 pm

dunbarx wrote:
Sat Jul 11, 2020 3:17 pm
We will soon tire of this. We always do. But generally there is value and fun along the way.

But,
Good linguistic analysis.

Same result.
Thank you.

Nope. If you click on an object that is disabled, the message likely passes into the card...
...except with image objects, which is the subject of this thread. So next time I'll be more specific with my wording.

In fact, neither disabling the object nor blocking the message will by itself do what Richmond is asking for, since he's not asking for the message to go to the card, but to a control beneath the target. There is no property for that. A handler is needed.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Passing mouse clicks up the object heirarchy

Post by jacque » Sat Jul 11, 2020 7:28 pm

FourthWorld wrote:
Sat Jul 11, 2020 6:23 pm
...except with image objects, which is the subject of this thread. So next time I'll be more specific with my wording.

In fact, neither disabling the object nor blocking the message will by itself do what Richmond is asking for, since he's not asking for the message to go to the card, but to a control beneath the target. There is no property for that. A handler is needed.
A disabled image will allow the control under it to receive the mouse message. Actually I just tried it with a disabled button and a disabled field and they also allows mouseclicks to trigger the object under it. Interesting. Maybe they all do.

Images are the only controls I know of that don't change their appearance when disabled, though.

Here's a screenshot of my test. While the green circle looks normal, it's actually a disabled image. The button and label field are disabled, which you can see. The blue rectangle is not disabled. Each object has a script that puts its name into the message box. If I click on a disabled control in the area overlapping the rectangle, the target responds it is the rectangle. If I click the same object outside the blue area, the target is the card.
Attachments
Screen Shot 2020-07-11 at 1.32.00 PM.png
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Passing mouse clicks up the object heirarchy

Post by dunbarx » Sat Jul 11, 2020 8:10 pm

Jacque.

This is now expected behavior, no? You were the one who pointed this out. The only thing that threw me initially was I did not know that images remained intact when disabled. As Richard said, Richmond did not need images NOT to trap messages, but rather that a specific image carry the load.
Having the card be the final recipient as the message went upwards (hmph, ahem) would have made that simple.

Too many ways to skin the cat

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10090
Joined: Fri Feb 19, 2010 10:17 am

Re: Passing mouse clicks up the object heirarchy

Post by richmond62 » Sat Jul 11, 2020 8:52 pm

Right from the coo's gab:
-
cow-scot-mountain-wild-ginger-herbivore-animal.jpg
-

The reason I DO NOT want to use DISABLED is because while I want mouseUp
to be picked up by something in a layer with a lower number than the 'floating' image
I still want the 'floating' image to be able to pick up other signals, like this:

Code: Select all

on mouseUp
send mouseUp to img "thingBelowMe"
end mouseUp

on mouseEnter
put "Cheese"
end mouseEnter

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Passing mouse clicks up the object heirarchy

Post by dunbarx » Sat Jul 11, 2020 9:33 pm

Richmond.

First time I heard about this other functionality.

So go explicit. Enable all. Group the overlying images so you only have to write one handler, except for the "working" image.

Craig

Post Reply