From 3e275c2d1d14cd18936bab227416a8389386eb8f Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Wed, 16 Mar 2005 16:03:17 +0000 Subject: [PATCH] Unlike the preferences item which should only be enabled if it exists and is enabled, the quit item should be enabled unless it both exists and is disabled, otherwise Quit will not be enabled unless the application specifically adds wxID_EXIT. This should fix David's bug but still retain the old functionality. [ modified previously committed patch 1160343 ] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/menu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 4a88133f5d..4761918b33 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -675,10 +675,14 @@ 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()) ) + if ( item != NULL && !(item->IsEnabled()) ) DisableMenuCommand( NULL , kHICommandQuit ) ; else EnableMenuCommand( NULL , kHICommandQuit ) ;