Stack menus
Peter Haworth
pete at lcsql.com
Thu May 30 16:46:26 EDT 2013
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 <kray at sonsothunder.com> 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: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list