]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
Correct erasing of background behind controls in a toolbar in wxMSW.
[wxWidgets.git] / src / msw / mdi.cpp
index e6ea206faccd5f524ec7db4125a2015bc632e55d..0645e4beb50fbf4b3303046f65596b728338174d 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Julian Smart
 // Modified by: Vadim Zeitlin on 2008-11-04 to use the base classes
 // Created:     04/01/98
 // Author:      Julian Smart
 // Modified by: Vadim Zeitlin on 2008-11-04 to use the base classes
 // Created:     04/01/98
-// RCS-ID:      $Id$
 // Copyright:   (c) 1998 Julian Smart
 //              (c) 2008-2009 Vadim Zeitlin
 // Licence:     wxWindows licence
 // Copyright:   (c) 1998 Julian Smart
 //              (c) 2008-2009 Vadim Zeitlin
 // Licence:     wxWindows licence
@@ -428,11 +427,14 @@ void wxMDIParentFrame::DoMenuUpdates(wxMenu* menu)
 
 wxMenuItem *wxMDIParentFrame::FindItemInMenuBar(int menuId) const
 {
 
 wxMenuItem *wxMDIParentFrame::FindItemInMenuBar(int menuId) const
 {
-    wxMenuItem *item = wxFrame::FindItemInMenuBar(menuId);
-    if ( !item && GetActiveChild() )
-    {
-        item = GetActiveChild()->FindItemInMenuBar(menuId);
-    }
+    // We must look in the child menu first: if it has an item with the same ID
+    // as in our own menu bar, the child item should be used to determine
+    // whether it's currently enabled.
+    wxMenuItem *item = GetActiveChild()
+                            ? GetActiveChild()->FindItemInMenuBar(menuId)
+                            : NULL;
+    if ( !item )
+        item = wxFrame::FindItemInMenuBar(menuId);
 
     if ( !item && m_windowMenu )
         item = m_windowMenu->FindItem(menuId);
 
     if ( !item && m_windowMenu )
         item = m_windowMenu->FindItem(menuId);
@@ -695,20 +697,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)