]> git.saurik.com Git - wxWidgets.git/commitdiff
bug corrected
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 2 Nov 1999 17:39:20 +0000 (17:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 2 Nov 1999 17:39:20 +0000 (17:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/frame.cpp
src/gtk1/frame.cpp

index 2deb4641eac62e4c9d56d4912caf4be3236a8e60..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();
             }
         }
 
index 2deb4641eac62e4c9d56d4912caf4be3236a8e60..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();
             }
         }