]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/frame.cpp
wxUSE_RADIOBOX/SLIDER/SPINCTRL added
[wxWidgets.git] / src / gtk / frame.cpp
index 928f7fa9000a2e9b70ae62d14d26ebd1ef350e22..0f1306462d64b74c7b119fd96f52ff0525ff08a2 100644 (file)
@@ -940,12 +940,16 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event)
         wxString helpString;
 
         int menuId = event.GetMenuId();
-        if ( menuId != -1 )
+        if ( menuId != wxID_SEPARATOR && menuId != -2 /* wxID_TITLE */ )
         {
             wxMenuBar *menuBar = GetMenuBar();
-            if (menuBar)
+            if ( menuBar )
             {
-                helpString = menuBar->GetHelpString(menuId);
+                // it's ok if we don't find the item because it might belong to
+                // the popup menu
+                wxMenuItem *item = menuBar->FindItem(menuId);
+                if ( item )
+                    helpString = item->GetHelp();
             }
         }
 
@@ -1070,10 +1074,10 @@ void wxFrame::Command( int id )
     wxMenuBar *bar = GetMenuBar();
     if (!bar) return;
 
-    wxMenuItem *item = bar->FindItemForId(id) ;
+    wxMenuItem *item = bar->FindItem(id) ;
     if (item && item->IsCheckable())
     {
-        bar->Check(id,!bar->Checked(id)) ;
+        bar->Check(id, !bar->IsChecked(id)) ;
     }
 
     wxEvtHandler* evtHandler = GetEventHandler();