// ----------------------
#include <string.h>
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
-#endif
// the (popup) menu title has this special id
static const int idMenuTitle = -3;
}
}
// if we're already attached to the menubar, we must update it
- if ( IsAttached() )
+ if ( IsAttached() && GetMenuBar()->IsAttached() )
{
GetMenuBar()->Refresh();
}
::DeleteMenuItem(MAC_WXHMENU(m_hMenu) , pos + 1);
- if ( IsAttached() )
+ if ( IsAttached() && GetMenuBar()->IsAttached() )
{
// otherwise, the change won't be visible
GetMenuBar()->Refresh();
wxMenuBar* wxMenuBar::s_macInstalledMenuBar = NULL ;
wxMenuBar* wxMenuBar::s_macCommonMenuBar = NULL ;
+bool wxMenuBar::s_macAutoWindowMenu = true ;
+WXHMENU wxMenuBar::s_macWindowMenuHandle = NULL ;
void wxMenuBar::Init()
{
UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
}
}
+ if ( GetAutoWindowMenu() )
+ {
+ if ( MacGetWindowMenuHMenu() == NULL )
+ {
+ CreateStandardWindowMenu( 0 , (MenuHandle*) &s_macWindowMenuHandle ) ;
+ }
+ InsertMenu( (MenuHandle) MacGetWindowMenuHMenu() , 0 ) ;
+ }
::DrawMenuBar() ;
s_macInstalledMenuBar = this;
}