From 10c1d2177a232195ac24190d7c16ed6dcbd790f7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 2 Nov 1999 17:39:20 +0000 Subject: [PATCH] bug corrected git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/frame.cpp | 10 +++++++--- src/gtk1/frame.cpp | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 2deb4641ea..0f1306462d 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -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(); } } diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 2deb4641ea..0f1306462d 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -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(); } } -- 2.45.2