don't clear the status bar help text if the wxEVT_MENU_HIGHLIGHT event was processed by user code (see #10822)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -915,33 +915,25 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
|
||||
|
||||
bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
|
||||
{
|
||||
int item;
|
||||
if ( flags == 0xFFFF && hMenu == 0 )
|
||||
{
|
||||
// menu was removed from screen
|
||||
item = -1;
|
||||
}
|
||||
#ifndef __WXMICROWIN__
|
||||
else if ( !(flags & MF_POPUP) && !(flags & MF_SEPARATOR) )
|
||||
{
|
||||
item = nItem;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
// don't give hints for separators (doesn't make sense) nor for the
|
||||
// items opening popup menus (they don't have them anyhow) but do clear
|
||||
// the status line - otherwise, we would be left with the help message
|
||||
// for the previous item which doesn't apply any more
|
||||
DoGiveHelp(wxEmptyString, true);
|
||||
|
||||
return false;
|
||||
}
|
||||
// WM_MENUSELECT is generated for both normal items and menus, including
|
||||
// the top level menus of the menu bar, which can't be represented using
|
||||
// any valid identifier in wxMenuEvent so use -1 for them
|
||||
// the menu highlight events for n
|
||||
const int item = flags & (MF_POPUP | MF_SEPARATOR) ? -1 : nItem;
|
||||
|
||||
wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item);
|
||||
event.SetEventObject(this);
|
||||
|
||||
return HandleWindowEvent(event);
|
||||
if ( HandleWindowEvent(event) )
|
||||
return true;
|
||||
|
||||
// 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 )
|
||||
DoGiveHelp(wxEmptyString, true);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxFrame::HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup)
|
||||
|
Reference in New Issue
Block a user