]> git.saurik.com Git - wxWidgets.git/commitdiff
Unlike the preferences item which should only be enabled if it exists and is enabled...
authorKevin Hock <hockkn@yahoo.com>
Wed, 16 Mar 2005 16:03:17 +0000 (16:03 +0000)
committerKevin Hock <hockkn@yahoo.com>
Wed, 16 Mar 2005 16:03:17 +0000 (16:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/menu.cpp

index 4a88133f5ddeed98734f19809a110b2569283469..4761918b3369352a34fd089e68fb608b3b74ee48 100644 (file)
@@ -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 ) ;