git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50700
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool wxMenu::ProcessCommand(wxCommandEvent & event)
{
bool wxMenu::ProcessCommand(wxCommandEvent & event)
{
- bool processed = false;
+ // Try the menu's event handler first
+ wxEvtHandler * const handler = GetEventHandler();
+ bool processed = handler ? handler->SafelyProcessEvent(event) : false;
- // Try the menu's event handler
- if ( !processed && GetEventHandler())
- {
- processed = HandleWindowEvent(event);
- }
// Try the window the menu was popped up from (and up
// through the hierarchy)
if ( !processed && GetInvokingWindow())
// Try the window the menu was popped up from (and up
// through the hierarchy)
if ( !processed && GetInvokingWindow())
- processed = GetInvokingWindow()->ProcessEvent(event);
+ processed = GetInvokingWindow()->HandleWindowEvent(event);