From eb68a54a40fbd544357be032128c77f876961a3c Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 20 Apr 2010 20:29:22 +0000 Subject: [PATCH] restoring special handling for carbon system menu items, fixes #11819 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/menu_osx.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index 9e2da30874..14e8667181 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -409,6 +409,33 @@ bool wxMenu::HandleCommandUpdateStatus( wxMenuItem* item, wxWindow* senderWindow if (event.GetSetEnabled()) Enable(id, event.GetEnabled()); } + else + { +#if wxOSX_USE_CARBON + // these two items are also managed by the Carbon Menu Manager, therefore we must + // always reset them ourselves + UInt32 cmd = 0; + + if ( id == wxApp::s_macExitMenuItemId ) + { + cmd = kHICommandQuit; + } + else if (id == wxApp::s_macPreferencesMenuItemId ) + { + cmd = kHICommandPreferences; + } + + if ( cmd != 0 ) + { + if ( !item->IsEnabled() || wxDialog::OSXHasModalDialogsOpen() ) + DisableMenuCommand( NULL , cmd ) ; + else + EnableMenuCommand( NULL , cmd ) ; + + } +#endif + } + return processed; } @@ -566,7 +593,7 @@ void wxMenuBar::MacInstallMenuBar() return ; m_rootMenu->GetPeer()->MakeRoot(); - // DisableMenuCommand( NULL , kHICommandPreferences ) ; + #if 0 MenuBarHandle menubar = NULL ;