Harmonize wxMenuEvent handling between all major ports.
Send these events to the menu itself first, then to the menu bar containing it or the window invoking it if it's a popup menu and, finally, to the top level window in all of wxGTK, wxMSW and wxOSX. In particular, this ensures that help strings are now shown in the parent MDI frame status bar by default, even when the menus are attached to the client MDI frame or shown as popup menus. At the implementation level, this logic is now encapsulated in a new static wxMenu::ProcessMenuEvent() method which can be easily modified and reused in other ports. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -74,16 +74,7 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event)
|
||||
if ( !IsMenuEventAllowed(menu) )
|
||||
return;
|
||||
|
||||
event.SetEventObject( menu );
|
||||
|
||||
wxEvtHandler* handler = menu->GetEventHandler();
|
||||
if (handler && handler->SafelyProcessEvent(event))
|
||||
return;
|
||||
|
||||
wxWindow *win = menu->GetWindow();
|
||||
wxCHECK_RET( win, "event for a menu without associated window?" );
|
||||
|
||||
win->HandleWindowEvent( event );
|
||||
wxMenu::ProcessMenuEvent(menu, event, menu->GetWindow());
|
||||
}
|
||||
|
||||
// Return the top level menu containing this menu (possibly this menu itself).
|
||||
|
Reference in New Issue
Block a user