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)
}
#if wxUSE_ACCEL
- delete m_accelWindowMenu;
- m_accelWindowMenu = NULL;
+ wxDELETE(m_accelWindowMenu);
if ( menu && menu->HasAccels() )
m_accelWindowMenu = menu->CreateAccelTable();
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;