X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a57bd93ad118049af9a5b2c07e01254f625f6a2..486fa39656e55e4655ab819710c66506d64000cf:/src/osx/menu_osx.cpp diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index e251fa461d..c10dba486e 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -4,7 +4,7 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: menu.cpp 54129 2008-06-11 19:30:52Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -515,13 +515,32 @@ void wxMenuBar::Init() m_appleMenu = new wxMenu(); m_appleMenu->SetAllowRearrange(false); - m_appleMenu->Append( wxApp::s_macAboutMenuItemId, "About..." ); - m_appleMenu->AppendSeparator(); + + // Create standard items unless the application explicitly disabled this by + // setting the corresponding ids to wxID_NONE: although this is not + // recommended, sometimes these items really don't make sense. + if ( wxApp::s_macAboutMenuItemId != wxID_NONE ) + { + wxString aboutLabel("About"); + if ( wxTheApp ) + aboutLabel << ' ' << wxTheApp->GetAppDisplayName(); + else + aboutLabel << "..."; + m_appleMenu->Append( wxApp::s_macAboutMenuItemId, aboutLabel); + m_appleMenu->AppendSeparator(); + } + #if !wxOSX_USE_CARBON - m_appleMenu->Append( wxApp::s_macPreferencesMenuItemId, "Preferences..." ); - m_appleMenu->AppendSeparator(); + if ( wxApp::s_macPreferencesMenuItemId != wxID_NONE ) + { + m_appleMenu->Append( wxApp::s_macPreferencesMenuItemId, + "Preferences...\tCtrl+," ); + m_appleMenu->AppendSeparator(); + } + + // Do always add "Quit" item unconditionally however, it can't be disabled. m_appleMenu->Append( wxApp::s_macExitMenuItemId, "Quit\tCtrl+Q" ); -#endif +#endif // !wxOSX_USE_CARBON m_rootMenu->AppendSubMenu(m_appleMenu, "\x14") ; }