]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/menu_osx.cpp
No real changes, just remove unnecessary const workaround.
[wxWidgets.git] / src / osx / menu_osx.cpp
index e251fa461d7762bfab13dc521ddbc9ca24e21d14..c10dba486ec64294c524a93c0ebc11e8d4f87cd9 100644 (file)
@@ -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") ;
 }