generate command events for accelerators even when there is no menu bar (#9784) fixing the bug introduced in r54510

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-10-03 22:01:56 +00:00
parent 98b423c884
commit ad4cb2a1df
2 changed files with 11 additions and 21 deletions

View File

@@ -101,6 +101,10 @@ All (Unix):
- Return false from wxSingleInstanceChecker::IsAnotherRunning() if an error
occurred while opening or reading the lock file (Lauri Nurmi).
wxMSW:
- Restored generation of events for accelerators when there is no menu bar.
wxGTK:
- Fixed printing to use fonts sizes adjustment consistent with wxMSW.

View File

@@ -954,34 +954,20 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
return win->MSWCommand(cmd, id);
}
// handle here commands from menus and accelerators
if ( cmd == 0 || cmd == 1 )
// handle here commands from menus and accelerators for our menu bar items,
// all the rest is handled by wxWindow itself
if ( !control && (cmd == 0 /* menu */ || cmd == 1 /* accel */) )
{
#if wxUSE_MENUS_NATIVE
if ( wxCurrentPopupMenu )
{
wxMenu *popupMenu = wxCurrentPopupMenu;
wxCurrentPopupMenu = NULL;
return popupMenu->MSWCommand(cmd, id);
}
if ( !wxCurrentPopupMenu )
#endif // wxUSE_MENUS_NATIVE
#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
// handle here commands from Smartphone menu bar
if ( wxTopLevelWindow::HandleCommand(id, cmd, control ) )
{
return true;
}
#endif // __SMARTPHONE__ && __WXWINCE__
if ( ProcessCommand(id) )
{
return true;
if ( GetMenuBar() && ProcessCommand(id) )
return true;
}
}
return false;
return wxFrameBase::HandleCommand(id, cmd, control);
}
bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)