]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/menu_osx.cpp
don't swallow command events that are not handled by accels, fixes #12373
[wxWidgets.git] / src / osx / menu_osx.cpp
index a6d6f2c56ba1bc3e7e8fbacff5081f3914320387..54b2d6aa917ce85e11ad8ea1ac9a7912b865b223 100644 (file)
@@ -595,7 +595,36 @@ void wxMenuBar::MacInstallMenuBar()
         return ;
 
     m_rootMenu->GetPeer()->MakeRoot();
-
+    
+    // hide items in the apple menu that don't exist in the wx menubar
+    
+    int id = 0;
+    wxMenuItem* appleItem = NULL;
+    wxMenuItem* wxItem = NULL;
+
+    id = wxApp::s_macAboutMenuItemId;
+    appleItem = m_appleMenu->FindItem(id);
+    wxItem = FindItem(id);
+    if ( appleItem != NULL )
+    {
+        if ( wxItem == NULL )
+            appleItem->GetPeer()->Hide();
+        else 
+            appleItem->SetItemLabel(wxItem->GetItemLabel());
+    }
+    
+    id = wxApp::s_macPreferencesMenuItemId;
+    appleItem = m_appleMenu->FindItem(id);
+    wxItem = FindItem(id);
+    if ( appleItem != NULL )
+    {
+        if ( wxItem == NULL )
+            appleItem->GetPeer()->Hide();
+        else 
+            appleItem->SetItemLabel(wxItem->GetItemLabel());
+    }
+    
+        
 #if 0
 
     MenuBarHandle menubar = NULL ;