From: Vadim Zeitlin Date: Wed, 9 May 2012 14:24:23 +0000 (+0000) Subject: Attach MDI "Window" menu to the parent frame menu bar in wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/679dc4e813b85bb2f36bd58c9ea3ff7327ad551c?ds=sidebyside Attach MDI "Window" menu to the parent frame menu bar in wxMSW. 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 --- diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 6dbb49ea1a..dd19650db6 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -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)