X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4f42c05a1a956878cb6ef28c9faabbf801361e6d..96c9640205933ad0673d5af2c96af0816c50160c:/src/msw/mdi.cpp diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 9bcee0a86a..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) @@ -369,8 +379,7 @@ void wxMDIParentFrame::SetWindowMenu(wxMenu* menu) } #if wxUSE_ACCEL - delete m_accelWindowMenu; - m_accelWindowMenu = NULL; + wxDELETE(m_accelWindowMenu); if ( menu && menu->HasAccels() ) m_accelWindowMenu = menu->CreateAccelTable(); @@ -686,7 +695,7 @@ bool wxMDIParentFrame::TryBefore(wxEvent& event) if ( event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED ) { wxMDIChildFrame * const child = GetActiveChild(); - if ( child && child->ProcessEventHere(event) ) + if ( child && child->ProcessWindowEventLocally(event) ) return true; } @@ -1112,7 +1121,7 @@ bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate), WXHMENU hMenuParent = parent->m_hMenu; - // activate the the parent menu only when there is no other child + // activate the parent menu only when there is no other child // that has been activated if ( hMenuParent && !hwndAct ) hMenuToSet = hMenuParent;