]> git.saurik.com Git - wxWidgets.git/commitdiff
Attach MDI "Window" menu to the parent frame menu bar in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 May 2012 14:24:23 +0000 (14:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 May 2012 14:24:23 +0000 (14:24 +0000)
This makes sense and fixes the regression with "Window" menu commands not
being processed any more after the changes of r71114.

Closes #14207.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/mdi.cpp

index 6dbb49ea1ade739da71d948e336386e4e008525c..dd19650db6d4289e30d5fe7f596135cd464498e4 100644 (file)
@@ -317,13 +317,23 @@ void wxMDIParentFrame::RemoveMDIChild(wxMDIChildFrame * WXUNUSED(child))
 void wxMDIParentFrame::AddWindowMenu()
 {
     if ( m_windowMenu )
+    {
+        // For correct handling of the events from this menu we also must
+        // attach it to the menu bar.
+        m_windowMenu->Attach(GetMenuBar());
+
         MDIInsertWindowMenu(GetClientWindow(), m_hMenu, GetMDIWindowMenu(this));
+    }
 }
 
 void wxMDIParentFrame::RemoveWindowMenu()
 {
     if ( m_windowMenu )
+    {
         MDIRemoveWindowMenu(GetClientWindow(), m_hMenu);
+
+        m_windowMenu->Detach();
+    }
 }
 
 void wxMDIParentFrame::UpdateWindowMenu(bool enable)