Return correct menu pointer for wxEVT_MENU_{OPEN,CLOSE} in MDI frames.
These events are supposed to carry a pointer to the menu which was opened or closed, but wxMenuEvent::GetMenu() always returned NULL for the menus opened when a child MDI frame was active, as its menu bar, containing the menu, was not searched for it. Fix this by overriding MSWFindMenuFromHMENU() at wxMDIParentFrame level, just as we already do for FindItemInMenuBar(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -103,9 +103,10 @@ public:
|
||||
virtual bool MSWTranslateMessage(WXMSG* msg);
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// override wxFrameBase function to also look in the active child menu bar
|
||||
// and the "Window" menu
|
||||
// override the menu-relayed methods to also look in the active child menu
|
||||
// bar and the "Window" menu
|
||||
virtual wxMenuItem *FindItemInMenuBar(int menuId) const;
|
||||
virtual wxMenu* MSWFindMenuFromHMENU(WXHMENU hMenu);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user