- if ( IsMdiCommandId(id) )
- {
- wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
- while ( node )
- {
- wxWindow *child = node->GetData();
- if ( child->GetHWND() )
- {
- int childId = wxGetWindowId(child->GetHWND());
- if ( childId == (signed short)id )
- {
- ::SendMessage( GetWinHwnd(GetClientWindow()),
- WM_MDIACTIVATE,
- (WPARAM)child->GetHWND(), 0);
- return true;
- }
- }
- node = node->GetNext();
- }
- }
- else if ( m_parentFrameActive )
- {
- return ProcessCommand(id);
- }
- else if ( m_currentChild )
- {
- return m_currentChild->HandleCommand(id, cmd, hwnd);
- }
- else
+bool wxMDIParentFrame::TryBefore(wxEvent& event)
+{
+ // menu (and toolbar) events should be sent to the active child frame
+ // first, if any
+ if ( event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED )