A help event is sent when the user has requested context-sensitive help. This can either be caused by the application requesting context-sensitive help mode via wxContextHelp, or (on MS Windows) by the system generating a WM_HELP message when the user pressed F1 or clicked on the query button in a dialog caption.
A help event is sent to the window that the user clicked on, and is propagated up the window hierarchy until the event is processed or there are no more event handlers. The application should call wxEvent::GetId to check the identity of the clicked-on window, and then either show some suitable help or call wxEvent::Skip if the identifier is unrecognised. Calling Skip is important because it allows wxWidgets to generate further events for ancestors of the clicked-on window. Otherwise it would be impossible to show help for container windows, since processing would stop after the first window found.
Event table macros
To process an activate event, use these event handler macros to direct input to a member function that takes a wxHelpEvent argument.
|EVT_HELP(id, func)||Process a wxEVT_HELP event.|
|EVT_HELP_RANGE(id1, id2, func)||Process a wxEVT_HELP event for a range of ids.|
wxContextHelp, wxDialog, Event handling overview
wxHelpEvent(WXTYPE eventType = 0, wxWindowID id = 0, const wxPoint& point)
wxHelpEvent::Origin GetOrigin() const
Returns the origin of the help event which is one of the following values:
|Origin_Unknown||Unrecognized event source.|
|Origin_Keyboard||Event generated by F1 key press.|
|Origin_HelpButton||Event generated by wxContextHelp or using the "?" title bur button under MS Windows.|
The application may handle events generated using the keyboard or mouse differently, e.g. by using wxGetMousePosition() for the mouse events.
const wxPoint& GetPosition() const
Returns the left-click position of the mouse, in screen coordinates. This allows the application to position the help appropriately.
void SetOrigin(wxHelpEvent::Origin origin)
Set the help event origin, only used internally by wxWidgets normally.
void SetPosition(const wxPoint& pt)
Sets the left-click position of the mouse, in screen coordinates.