Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
2 posts • Page 1 of 1
I've gotten to like the office ribbon, and I'm trying to achieve something vaguely similar by "attaching" a ChoiceBook to a menubar: that is, clicking on a menubar label triggers a choicebook SetSelection(), inside an OnMenuOpen event handler. Some of the menubar menus are "real" drop-down menus; the others I leave blank (i.e, I don't append any menuitems to them). It works OK, but I'm finding that if one of those empty menu labels is clicked, triggering OnMenuOpen, it grabs the mouse and keyboard focus and won't let other controls respond to certain events (they'll respond to clicks, but that's because clicks force the menu to close). What I need is a method that will dynamically close the menu which triggered the OnMenuOpen event (there's an OnMenuClose event but there doesn't seem to be a wxMenu::Close or wxMenuBar::Close member). If that's not doable, I suppose I could simulate a menubar with a panel, some static texts, and a few popup menus, but then is there some easy way to get the look of a menubar (background styles, button appearance, etc.)? Everything I've tried doesn't look right.
(using MSW, VC++ '05, 2.8.7)