Stack menus

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

Stack menus

Peter Haworth
Putting together a stack menu for the first time and finding a couple of
issues.

The menu object is a pulldown menu with its menuName set to the stack I
want displayed.  The stack menu displays fine but a couple of.

When the mouse rolls over one of the stack  menu options, it's background
becomes a very dark blue color.  Looking for guidance on how to fix that
since I've tried the obvious color settings to no avail.  Maybe some other
property needs (un)setting?

The other issue seems to a difference in how the message path works when I
click on a button in the stack menu.  I have a mouseUp handler in each
stack menu button which calls a handler I have at the card level.  In
debug, I see the mouseUp handler executing but even though it executes the
call to the card hanlder, the card level handler never executes.

I've worked round it by putting the mouseUp handler at the card level,
arguably a better solution anyway but curious about this behavior.

Pete
lcSQL Software <http://www.lcsql.com>
_______________________________________________
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: Stack menus

Paul Hibbert

On 2013-05-28, at 6:57 PM, Peter Haworth wrote:

> Putting together a stack menu for the first time and finding a couple of
> issues.
>
> The menu object is a pulldown menu with its menuName set to the stack I
> want displayed.  The stack menu displays fine but a couple of.
>
> When the mouse rolls over one of the stack  menu options, it's background
> becomes a very dark blue color.  Looking for guidance on how to fix that
> since I've tried the obvious color settings to no avail.  Maybe some other
> property needs (un)setting?

You can set the 'Hilite' colour for the MenuBar group to whatever colour you prefer, unfortunately the default is dark blue and not the user's system highlight colour. However, if you check the 'Set as stack menubar' in the menu builder AFAIK it will then use the system highlight colour and take on the same appearance of the system menus on Win and use the system menubar on Mac.

> The other issue seems to a difference in how the message path works when I
> click on a button in the stack menu.  I have a mouseUp handler in each
> stack menu button which calls a handler I have at the card level.  In
> debug, I see the mouseUp handler executing but even though it executes the
> call to the card hanlder, the card level handler never executes.

> I've worked round it by putting the mouseUp handler at the card level,
> arguably a better solution anyway but curious about this behavior.

It seems that mouseUp handlers don't work if the menuPick message is used in a pulldown menu script, from what I can see you can have one or the other, so your workaround may be the best option.

Paul
_______________________________________________
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: Stack menus

Peter Haworth
Hi Paul,
I think we're talking about different things here, probably because I
didn't explain very well!

You're referring to menus used as menu bars, I think and yes I've seen this
issues you mentioned when creating those.  I remember the issue of having
to use a group script to handle mouseUp because they didn;t trigger in the
button scripts.  In fact, I think it was worse than that because there was
something different about how that worked on Widnows and Macs (not sure
about Linux).  I can't remember for sure but I think it was something to do
with using "the target" to figure out which menu the mouseUp came from.

My situation though is when you use a stack as the contents of a menu
button by naming the stack in the menuName property.  I'm using that
feature because I want to have icons in my menu items as opposed to simple
text.  I'm not concerned about the mouseUp issue, just taking it as another
little LC oddity but I wish I could find a way to get round the background
color issue.

Pete
lcSQL Software <http://www.lcsql.com>


On Tue, May 28, 2013 at 8:33 PM, Paul Hibbert <[hidden email]> wrote:

>
> On 2013-05-28, at 6:57 PM, Peter Haworth wrote:
>
> > Putting together a stack menu for the first time and finding a couple of
> > issues.
> >
> > The menu object is a pulldown menu with its menuName set to the stack I
> > want displayed.  The stack menu displays fine but a couple of.
> >
> > When the mouse rolls over one of the stack  menu options, it's background
> > becomes a very dark blue color.  Looking for guidance on how to fix that
> > since I've tried the obvious color settings to no avail.  Maybe some
> other
> > property needs (un)setting?
>
> You can set the 'Hilite' colour for the MenuBar group to whatever colour
> you prefer, unfortunately the default is dark blue and not the user's
> system highlight colour. However, if you check the 'Set as stack menubar'
> in the menu builder AFAIK it will then use the system highlight colour and
> take on the same appearance of the system menus on Win and use the system
> menubar on Mac.
>
> > The other issue seems to a difference in how the message path works when
> I
> > click on a button in the stack menu.  I have a mouseUp handler in each
> > stack menu button which calls a handler I have at the card level.  In
> > debug, I see the mouseUp handler executing but even though it executes
> the
> > call to the card hanlder, the card level handler never executes.
>
> > I've worked round it by putting the mouseUp handler at the card level,
> > arguably a better solution anyway but curious about this behavior.
>
> It seems that mouseUp handlers don't work if the menuPick message is used
> in a pulldown menu script, from what I can see you can have one or the
> other, so your workaround may be the best option.
>
> Paul
> _______________________________________________
> 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: Stack menus

Ken Ray
In reply to this post by Peter Haworth
> When the mouse rolls over one of the stack  menu options, it's background
> becomes a very dark blue color.  Looking for guidance on how to fix that
> since I've tried the obvious color settings to no avail.  Maybe some other
> property needs (un)setting?

Peter, I think the reason you're seeting the dark blue color is that in the stack that is popping up you have buttons that have the 'autoArm' property set to true, which causes the button to automatically hilite when the mouse passes over it in the popup stack. You can change the color by setting the 'hiliteColor' property of the button(s) that are sitting on the popup stack. Or if you don't want it to hilite at all, you can set the 'armFill' property of the button(s) to false.

> The other issue seems to a difference in how the message path works when I
> click on a button in the stack menu.  I have a mouseUp handler in each
> stack menu button which calls a handler I have at the card level.  In
> debug, I see the mouseUp handler executing but even though it executes the
> call to the card hanlder, the card level handler never executes.
>
> I've worked round it by putting the mouseUp handler at the card level,
> arguably a better solution anyway but curious about this behavior.

OK, any script that you call from popup stack objects follow the hierarchy (AFAIK) of the menu button - that is suppose the main stack was called "Stack 1" and the popup stack was called "Stack 2":

   menu button (of Stack 2)
   card script (of Stack 2)
   stack script (of Stack 2)
   stack script (of Stack 1 - if Stack 2 is a substack of Stack 1)
   libraries/backscripts/etc.

Note that it never triggers the card script of Stack 1. Your 'mouseUp' handler is actually trapping the mouseUp of the button that *invoked* the popup stack… not the mouseUp on the menu button you ultimately selected.

So to get around this you'll need to use 'dispatch' or the equivalent from the script of the menu button in Stack 2 to the card in Stack 1, like:

(script of menu button of Stack 2:)
on menuPick pItemName
  dispatch "ItemSelected" to cd 1 of stack "Stack 1" with pItemName
end menuPick


Hope this helps,

Ken Ray
Sons of Thunder Software, Inc.
Email: [hidden email]
Web Site: http://www.sonsothunder.com/       

_______________________________________________
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: Stack menus

Peter Haworth
Thanks Ken, that clarified the color stuff.

I guess the fact that the armFIll and autoArm properties are not shown in
the IDE Inspector for a button makes it hard to figure this out!

Still puzzled by the message path though.  Using your example, I had a
mouseUp handler in a button in Stack2 which called a handler in Card 1 of
stack 2 so sounds like it should have executed.  Plus when I removed the
mouseUp handler from the button and re-titled the card handler to mouseUp,
all worked fine.  I'll see if I can check into that again.

Pete
lcSQL Software <http://www.lcsql.com>


On Wed, May 29, 2013 at 3:34 PM, Ken Ray <[hidden email]> wrote:

> > When the mouse rolls over one of the stack  menu options, it's background
> > becomes a very dark blue color.  Looking for guidance on how to fix that
> > since I've tried the obvious color settings to no avail.  Maybe some
> other
> > property needs (un)setting?
>
> Peter, I think the reason you're seeting the dark blue color is that in
> the stack that is popping up you have buttons that have the 'autoArm'
> property set to true, which causes the button to automatically hilite when
> the mouse passes over it in the popup stack. You can change the color by
> setting the 'hiliteColor' property of the button(s) that are sitting on the
> popup stack. Or if you don't want it to hilite at all, you can set the
> 'armFill' property of the button(s) to false.
>
> > The other issue seems to a difference in how the message path works when
> I
> > click on a button in the stack menu.  I have a mouseUp handler in each
> > stack menu button which calls a handler I have at the card level.  In
> > debug, I see the mouseUp handler executing but even though it executes
> the
> > call to the card hanlder, the card level handler never executes.
> >
> > I've worked round it by putting the mouseUp handler at the card level,
> > arguably a better solution anyway but curious about this behavior.
>
> OK, any script that you call from popup stack objects follow the hierarchy
> (AFAIK) of the menu button - that is suppose the main stack was called
> "Stack 1" and the popup stack was called "Stack 2":
>
>    menu button (of Stack 2)
>    card script (of Stack 2)
>    stack script (of Stack 2)
>    stack script (of Stack 1 - if Stack 2 is a substack of Stack 1)
>    libraries/backscripts/etc.
>
> Note that it never triggers the card script of Stack 1. Your 'mouseUp'
> handler is actually trapping the mouseUp of the button that *invoked* the
> popup stack… not the mouseUp on the menu button you ultimately selected.
>
> So to get around this you'll need to use 'dispatch' or the equivalent from
> the script of the menu button in Stack 2 to the card in Stack 1, like:
>
> (script of menu button of Stack 2:)
> on menuPick pItemName
>   dispatch "ItemSelected" to cd 1 of stack "Stack 1" with pItemName
> end menuPick
>
>
> Hope this helps,
>
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: [hidden email]
> Web Site: http://www.sonsothunder.com/
>
> _______________________________________________
> 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: Stack menus

Peter Haworth
In reply to this post by Ken Ray
Continuing on somewhat the same topic, is it possible to have a stack menu
with cascading subitems?  In other words, I'd like it to behave like an
option menu with sub items so that if I click on a line that has subitems,
the original line stays hilited and the subitems are listed alongside it.

Pete
lcSQL Software <http://www.lcsql.com>


On Wed, May 29, 2013 at 3:34 PM, Ken Ray <[hidden email]> wrote:

> > When the mouse rolls over one of the stack  menu options, it's background
> > becomes a very dark blue color.  Looking for guidance on how to fix that
> > since I've tried the obvious color settings to no avail.  Maybe some
> other
> > property needs (un)setting?
>
> Peter, I think the reason you're seeting the dark blue color is that in
> the stack that is popping up you have buttons that have the 'autoArm'
> property set to true, which causes the button to automatically hilite when
> the mouse passes over it in the popup stack. You can change the color by
> setting the 'hiliteColor' property of the button(s) that are sitting on the
> popup stack. Or if you don't want it to hilite at all, you can set the
> 'armFill' property of the button(s) to false.
>
> > The other issue seems to a difference in how the message path works when
> I
> > click on a button in the stack menu.  I have a mouseUp handler in each
> > stack menu button which calls a handler I have at the card level.  In
> > debug, I see the mouseUp handler executing but even though it executes
> the
> > call to the card hanlder, the card level handler never executes.
> >
> > I've worked round it by putting the mouseUp handler at the card level,
> > arguably a better solution anyway but curious about this behavior.
>
> OK, any script that you call from popup stack objects follow the hierarchy
> (AFAIK) of the menu button - that is suppose the main stack was called
> "Stack 1" and the popup stack was called "Stack 2":
>
>    menu button (of Stack 2)
>    card script (of Stack 2)
>    stack script (of Stack 2)
>    stack script (of Stack 1 - if Stack 2 is a substack of Stack 1)
>    libraries/backscripts/etc.
>
> Note that it never triggers the card script of Stack 1. Your 'mouseUp'
> handler is actually trapping the mouseUp of the button that *invoked* the
> popup stack… not the mouseUp on the menu button you ultimately selected.
>
> So to get around this you'll need to use 'dispatch' or the equivalent from
> the script of the menu button in Stack 2 to the card in Stack 1, like:
>
> (script of menu button of Stack 2:)
> on menuPick pItemName
>   dispatch "ItemSelected" to cd 1 of stack "Stack 1" with pItemName
> end menuPick
>
>
> Hope this helps,
>
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: [hidden email]
> Web Site: http://www.sonsothunder.com/
>
> _______________________________________________
> 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