PASSing out with frustration

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

PASSing out with frustration

Richmond Mathewson-2
I have a series of images used as buttons
with an optional overlay image that has
both transparent and semi-opaque areas.

When I mouse Down/Up over the opaque areas
I want the mouse Down / Up signals to
pass through the overlay to the images underlying it.

But I cannot get my thick head around the mechanics of
PASS.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Rick Harrison
Hi Richmond,

Check the location of the mouse.  If it is within
the same range as your opaque area send the
message click onto your opaque image.

Cheers,

Rick

On Feb 16, 2011, at 10:44 AM, Richmond wrote:

> I have a series of images used as buttons
> with an optional overlay image that has
> both transparent and semi-opaque areas.
>
> When I mouse Down/Up over the opaque areas
> I want the mouse Down / Up signals to
> pass through the overlay to the images underlying it.
>
> But I cannot get my thick head around the mechanics of
> PASS.




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Colin Holgate-2
In reply to this post by Richmond Mathewson-2

On Feb 16, 2011, at 10:44 AM, Richmond wrote:

> When I mouse Down/Up over the opaque areas
> I want the mouse Down / Up signals to
> pass through the overlay to the images underlying it.
>
> But I cannot get my thick head around the mechanics of
> PASS.

I believe that Pass only passes up the hierarchy, it doesn't pass the mouse click to things underneath the target.

If the image is a PNG with transparency, the underneath item gets the event if you're on a transparent area. Rick's suggestion would work, but requires that you know the object that is underneath. I tried doing:

      hide the target
      click at the clickloc
      show the target

but that didn't work out too well.

You might get what you want by setting the enabled of the overlay graphic to false.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Robert Brenstein
In reply to this post by Richmond Mathewson-2
On 16.02.11 at 17:44 +0200 Richmond apparently wrote:

>I have a series of images used as buttons
>with an optional overlay image that has
>both transparent and semi-opaque areas.
>
>When I mouse Down/Up over the opaque areas
>I want the mouse Down / Up signals to
>pass through the overlay to the images underlying it.
>
>But I cannot get my thick head around the mechanics of
>PASS.

Pass won't work since all objects are parallel to each other. You
need to use send to object. Have you tried to have no script in your
overlay object?

Robert

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Jeffrey Massung
In reply to this post by Richmond Mathewson-2
Here's what I do for my toolbars... Create a transparent button. Edit the
script of the button in the following way:

on mouseDown
   ## do click effect
end mouseDown

on mouseUp
  ## undo click effect
end mouseUp

on mouseRelease
  mouseUp
end mouseRelease


Now, hide that button. Make a series of new buttons, and set their images to
whatever you need them to be. Also, set their "behavior" to be the long ID
of the button you previously just made and hid.

There, you have your series of buttons. Just make sure you pass along the
actions tot he behaviors. For example, let's say you had a toobar button to
copy the current selection:

on mouseUp
  set the clipboardData["text"] to the selection

  ## perform toolbarButton behavior
  pass mouseUp
end mouseUp

The "mechanics" is that basically there is a chain or stack of message
handlers. I know there's a link out there that has the exact order, but it
would go something like this:

Control
Behavior Button
Group
Card
Stack

If your control has mouseUp, it stops there. If you PASS mouseUp somewhere
in that script, it will check to see if the (optional) behavior button
handles it. If that executes some code and PASSes it along, it will check
the group, etc.

Hope this helps,

Jeff M.

On Wed, Feb 16, 2011 at 8:44 AM, Richmond <[hidden email]>wrote:

> I have a series of images used as buttons
> with an optional overlay image that has
> both transparent and semi-opaque areas.
>
> When I mouse Down/Up over the opaque areas
> I want the mouse Down / Up signals to
> pass through the overlay to the images underlying it.
>
> But I cannot get my thick head around the mechanics of
> PASS.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Andre Garzia-3
In reply to this post by Rick Harrison
oh that is clever...

On Wed, Feb 16, 2011 at 2:03 PM, Rick Harrison
<[hidden email]> wrote:

> Hi Richmond,
>
> Check the location of the mouse.  If it is within
> the same range as your opaque area send the
> message click onto your opaque image.
>
> Cheers,
>
> Rick
>
> On Feb 16, 2011, at 10:44 AM, Richmond wrote:
>
>> I have a series of images used as buttons
>> with an optional overlay image that has
>> both transparent and semi-opaque areas.
>>
>> When I mouse Down/Up over the opaque areas
>> I want the mouse Down / Up signals to
>> pass through the overlay to the images underlying it.
>>
>> But I cannot get my thick head around the mechanics of
>> PASS.
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
http://www.andregarzia.com All We Do Is Code.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Richmond Mathewson-2
In reply to this post by Colin Holgate-2
On 02/16/2011 06:12 PM, Colin Holgate wrote:
> You might get what you want by setting the enabled of the overlay graphic to false.
>
>

I think I love you!  That is so simple and so effective, and "Just" works.

Thank you so much.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Andre Garzia-3
never heard of enabled... cool...

On Wed, Feb 16, 2011 at 2:22 PM, Richmond <[hidden email]> wrote:

> On 02/16/2011 06:12 PM, Colin Holgate wrote:
>>
>> You might get what you want by setting the enabled of the overlay graphic
>> to false.
>>
>>
>
> I think I love you!  That is so simple and so effective, and "Just" works.
>
> Thank you so much.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
http://www.andregarzia.com All We Do Is Code.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Richmond Mathewson-2
On 02/16/2011 07:40 PM, Andre Garzia wrote:
> never heard of enabled... cool...
>

Well; it certainly ENABLED me to get on with my work . . .  :)
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Colin Holgate-2
In reply to this post by Andre Garzia-3

On Feb 16, 2011, at 12:40 PM, Andre Garzia wrote:

> never heard of enabled... cool...

The funny thing is that I hadn't either, but I know from using Flash that a similar issue can be solved by setting the mouseEnabled to false, so I searched help for "enabled".
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

ScottR
Recently, Colin Holgate wrote:

> On Feb 16, 2011, at 12:40 PM, Andre Garzia wrote:
>
>> never heard of enabled... cool...
>
> The funny thing is that I hadn't either, but I know from using Flash that a
> similar issue can be solved by setting the mouseEnabled to false, so I
> searched help for "enabled".

Why you would jump through so many hoops to set the enabled of a control to
false when you can save 11 whole characters and simply disable it ;-)

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PASSing out with frustration

Andre Garzia-3
In reply to this post by Colin Holgate-2
On Wed, Feb 16, 2011 at 3:55 PM, Colin Holgate <[hidden email]> wrote:
>
> On Feb 16, 2011, at 12:40 PM, Andre Garzia wrote:
>
>> never heard of enabled... cool...
>
> The funny thing is that I hadn't either, but I know from using Flash that a similar issue can be solved by setting the mouseEnabled to false, so I searched help for "enabled".

once, long time ago, during the Era of CGI programming (I think it was
2.1 or earlier), I've crafted a whole templating engine for LiveCode
before learning there was a merge command that solved everything
faster....


> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
http://www.andregarzia.com All We Do Is Code.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode