diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index f83d3e488b..916c0ea76d 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -347,8 +347,10 @@ bool wxFrameBase::ShowMenuHelp(int menuId) { #if wxUSE_MENUS // if no help string found, we will clear the status bar text + // + // NB: wxID_NONE is used for (sub)menus themselves by wxMSW wxString helpString; - if ( menuId != wxID_SEPARATOR && menuId != -3 /* wxID_TITLE */ ) + if ( menuId != wxID_SEPARATOR && menuId != wxID_NONE ) { const wxMenuItem * const item = FindItemInMenuBar(menuId); if ( item && !item->IsSeparator() ) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index b820a08d21..2313b03a3c 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -904,7 +904,7 @@ wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU WXUNUSED(hMenu)) // any valid identifier in wxMenuEvent so use an otherwise unused value for // them if ( flags & (MF_POPUP | MF_SEPARATOR) ) - item = -1; + item = wxID_NONE; wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item); event.SetEventObject(this); @@ -915,7 +915,7 @@ wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU WXUNUSED(hMenu)) // by default, i.e. if the event wasn't handled above, clear the status bar // text when an item which can't have any associated help string in wx API // is selected - if ( item == -1 ) + if ( item == wxID_NONE ) DoGiveHelp(wxEmptyString, true); return false;