Re: Menu Question [message #67299 is a reply to message #67296] |
Sun, 12 July 2009 16:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Eric Hudson writes:
> I am having issues with menus and am hoping someone has a suggestion.
> Basically, I want a context menu look and functionality, with the
> ability to have accelerators (any idea why accelerators are forbidden
> for context menus?)
I think this is one of the 3 or 4 "Mysteries of the Universe",
if I'm not mistaken.
> I've tried just making a button group where each button spawns a
> pulldown menu (like what you get with CW_PDMENU) but it seems that the
> top level buttons can't have accelerators (while any button in the
> pulldown menus can).
>
> So then I thought I'd be clever and have a single top level button
> which I then programmatically 'push' in order to automatically drop
> down the menu. That is, I capture the right click on the draw window
> which says "time for a menu" then I show the top level base of my
> menu, with one button in it, and then tell the button to 'drop down
> your menu' without forcing the user to make the extra mouse click.
> But I can't figure out how to programmatically push the button -- send
> event doesn't seem to do it.
Did you try to use SEND_EVENT to put the event on the event queue?
What if you just called your button event handler directly from
your draw widget event handler, with an obviously fake "button"
event?
> On a related note, I wrote an extension to CW_PDMENU which allows the
> setting of accelerators and checked_menus for each menu item (rather
> than having the string 'code / menuitem name / handler' I just
> appended ' / accelerator / checked?' It works fine (except not for
> context menus and not for the top level buttons), but this seems like
> such an obvious thing to do I was wondering if it had been implemented
> elsewhere and I just missed it.
The best ideas are always the obvious ones. :-)
Cheers,
David
P.S. Context menus are pretty weird. I've never been able to
make them really sing and dance exactly the way I wanted them
to. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|