]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
missing commit
[wxWidgets.git] / src / msw / mdi.cpp
index e6ea206faccd5f524ec7db4125a2015bc632e55d..6ecd832ea5358c012073253ea7880d6c77789540 100644 (file)
@@ -577,6 +577,19 @@ WXLRESULT wxMDIParentFrame::MSWWindowProc(WXUINT message,
                     MSWDefWindowProc(message, wParam, lParam);
                     processed = true;
                 }
                     MSWDefWindowProc(message, wParam, lParam);
                     processed = true;
                 }
+                else // Not a system command.
+                {
+                    // Menu (and toolbar) events should be sent to the active
+                    // child first and only be processed by the parent frame if
+                    // they're not handled there.
+                    if ( wxMDIChildFrame* child = GetActiveChild() )
+                    {
+                        processed = child->MSWHandleMessage(&rc,
+                                                            message,
+                                                            wParam,
+                                                            lParam);
+                    }
+                }
             }
             break;
 
             }
             break;
 
@@ -695,20 +708,6 @@ void wxMDIParentFrame::OnMDICommand(wxCommandEvent& event)
 
 #endif // wxUSE_MENUS
 
 
 #endif // wxUSE_MENUS
 
-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 )
-    {
-        wxMDIChildFrame * const child = GetActiveChild();
-        if ( child && child->ProcessWindowEventLocally(event) )
-            return true;
-    }
-
-    return wxMDIParentFrameBase::TryBefore(event);
-}
-
 WXLRESULT wxMDIParentFrame::MSWDefWindowProc(WXUINT message,
                                         WXWPARAM wParam,
                                         WXLPARAM lParam)
 WXLRESULT wxMDIParentFrame::MSWDefWindowProc(WXUINT message,
                                         WXWPARAM wParam,
                                         WXLPARAM lParam)