X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/025357ca4feb7a7f4cfdc85cd1ff3c37b300c2b1..914955aaa034862c3b9b827463cde26455d06c79:/src/mac/carbon/menu.cpp diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 69824cf291..e07057a303 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -568,19 +568,6 @@ auto-merge for MDI in case this will be necessary */ -const wxMenuInfoList& wxMenuBar::GetMenuInfos() const -{ - wxMenuInfoList* list = const_cast< wxMenuInfoList* >( &m_menuInfos ) ; - WX_CLEAR_LIST( wxMenuInfoList , *list ) ; - for( size_t i = 0 ; i < GetMenuCount() ; ++i ) - { - wxMenuInfo* info = new wxMenuInfo() ; - info->Create( const_cast(this)->GetMenu(i) , GetLabelTop(i) ) ; - list->Append( info ) ; - } - return m_menuInfos ; -} - wxMenuBar* wxMenuBar::s_macInstalledMenuBar = NULL ; wxMenuBar* wxMenuBar::s_macCommonMenuBar = NULL ; @@ -602,13 +589,13 @@ wxMenuBar::wxMenuBar( long WXUNUSED(style) ) } -wxMenuBar::wxMenuBar(int count, wxMenu *menus[], const wxString titles[]) +wxMenuBar::wxMenuBar(size_t count, wxMenu *menus[], const wxString titles[], long WXUNUSED(style)) { Init(); m_titles.Alloc(count); - for ( int i = 0; i < count; i++ ) + for ( size_t i = 0; i < count; i++ ) { m_menus.Append(menus[i]); m_titles.Add(titles[i]); @@ -688,6 +675,18 @@ void wxMenuBar::MacInstallMenuBar() else EnableMenuCommand( NULL , kHICommandPreferences ) ; } + // Unlike preferences which may or may not exist, the Quit item should be always + // enabled unless it is added by the application and then disabled, otherwise + // a program would be required to add an item with wxID_EXIT in order to get the + // Quit menu item to be enabled, which seems a bit burdensome. + if ( UMAGetSystemVersion() >= 0x1000 && wxApp::s_macExitMenuItemId) + { + wxMenuItem *item = FindItem( wxApp::s_macExitMenuItemId , NULL ) ; + if ( item != NULL && !(item->IsEnabled()) ) + DisableMenuCommand( NULL , kHICommandQuit ) ; + else + EnableMenuCommand( NULL , kHICommandQuit ) ; + } #endif wxMenuList::compatibility_iterator menuIter = m_menus.GetFirst(); //