X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1bf168351b2e49c54ee960829ecf88debd7a7ab9..ed4eede6c2c16cdb422a39c1b3655956b8f51a1c:/src/mac/carbon/menu.cpp?ds=sidebyside diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 91e3471243..e07057a303 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -589,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]); @@ -675,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(); //