-bool wxMenu::ProcessCommand(
- wxCommandEvent& rEvent
-)
-{
- bool bProcessed = FALSE;
-
-#if wxUSE_MENU_CALLBACK
- //
- // Try a callback
- //
- if (m_callback)
- {
- (void)(*(m_callback))(*this, rEvent);
- bProcessed = TRUE;
- }
-#endif // wxUSE_MENU_CALLBACK
-
- //
- // Try the menu's event handler
- //
- if (!bProcessed && GetEventHandler())
- {
- bProcessed = GetEventHandler()->ProcessEvent(rEvent);
- }
-
- //
- // Try the window the menu was popped up from (and up through the
- // hierarchy)
- wxWindow* pWin = GetInvokingWindow();
-
- if (!bProcessed && pWin)
- bProcessed = pWin->GetEventHandler()->ProcessEvent(rEvent);
- return bProcessed;
-} // end of wxMenu::ProcessCommand
-