X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/41f38f4d596ddc17d20ddca9fc264523a8817e42..49a91764b57168d9f441578001b3206a7330ee70:/src/mac/menu.cpp diff --git a/src/mac/menu.cpp b/src/mac/menu.cpp index 621494b83d..3e6277ac5b 100644 --- a/src/mac/menu.cpp +++ b/src/mac/menu.cpp @@ -56,7 +56,11 @@ const short kwxMacAppleMenuId = 1 ; // Construct a menu with optional title (then use append) +#ifdef __UNIX__ +short wxMenu::s_macNextMenuId = 3 ; +#else short wxMenu::s_macNextMenuId = 2 ; +#endif void wxMenu::Init() { @@ -343,22 +347,6 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event) // other // --------------------------------------------------------------------------- -void wxMenu::Attach(wxMenuBar *menubar) -{ - // menu can be in at most one menubar because otherwise they would both - // delete the menu pointer - wxASSERT_MSG( !m_menuBar, wxT("menu belongs to 2 menubars, expect a crash") ); - - m_menuBar = menubar; -} - -void wxMenu::Detach() -{ - wxASSERT_MSG( m_menuBar, wxT("can't detach menu if it's not attached") ); - - m_menuBar = NULL; -} - wxWindow *wxMenu::GetWindow() const { if ( m_invokingWindow != NULL ) @@ -975,8 +963,6 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) if ( !wxMenuBarBase::Append(menu, title) ) return FALSE; - menu->Attach(this); - m_titles.Add(title); if ( IsAttached() ) @@ -1000,11 +986,14 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) return TRUE; } -void wxMenuBar::Attach(wxFrame *frame) +void wxMenuBar::Detach() { -// wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") ); + wxMenuBarBase::Detach() ; +} - m_menuBarFrame = frame; +void wxMenuBar::Attach(wxFrame *frame) +{ + wxMenuBarBase::Attach( frame ) ; #if wxUSE_ACCEL RebuildAccelTable();