added help event origin field: indicates if the help was requested using the mouse or from keyboard

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-05-26 02:21:38 +00:00
parent 851b88c310
commit b107e8d578
3 changed files with 42 additions and 4 deletions

View File

@@ -768,6 +768,23 @@ wxChildFocusEvent::wxChildFocusEvent(wxWindow *win)
SetEventObject(win);
}
// ----------------------------------------------------------------------------
// wxHelpEvent
// ----------------------------------------------------------------------------
/* static */
wxHelpEvent::Origin wxHelpEvent::GuessOrigin(Origin origin)
{
if ( origin == Origin_Unknown )
{
// assume that the event comes from the help button if it's not from
// keyboard and that pressing F1 always results in the help event
origin = wxGetKeyState(WXK_F1) ? Origin_Keyboard : Origin_HelpButton;
}
return origin;
}
#endif // wxUSE_GUI