Reuse the existing DoCommonMenuCallbackCode() function instead of duplicating
its code in menuitem_select() and menuitem_deselect() GTK callbacks.
No changes in behaviour.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64125
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if (!item->IsEnabled())
return;
if (!item->IsEnabled())
return;
- wxMenu* menu = item->GetMenu();
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item->GetId());
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item->GetId());
- event.SetEventObject( menu );
-
- wxEvtHandler* handler = menu->GetEventHandler();
- if (handler && handler->SafelyProcessEvent(event))
- return;
-
- wxWindow *win = menu->GetInvokingWindow();
- if (win) win->HandleWindowEvent( event );
+ DoCommonMenuCallbackCode(item->GetMenu(), event);
if (!item->IsEnabled())
return;
if (!item->IsEnabled())
return;
- wxMenu* menu = item->GetMenu();
wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, -1 );
wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, -1 );
- event.SetEventObject( menu );
-
- wxEvtHandler* handler = menu->GetEventHandler();
- if (handler && handler->SafelyProcessEvent(event))
- return;
-
- wxWindow *win = menu->GetInvokingWindow();
- if (win)
- win->HandleWindowEvent( event );
+ DoCommonMenuCallbackCode(item->GetMenu(), event);