]>
Commit | Line | Data |
---|---|---|
0460407f JS |
1 | \section{\class{wxHelpEvent}}\label{wxhelpevent} |
2 | ||
3 | A help event is sent when the user has requested context-sensitive help. | |
4 | This can either be caused by the application requesting | |
5 | context-sensitive help mode via \helpref{wxContextHelp}{wxcontexthelp}, or | |
6 | (on MS Windows) by the system generating a WM\_HELP message when the user pressed F1 or clicked | |
7 | on the query button in a dialog caption. | |
8 | ||
9 | A help event is sent to the window that the user clicked on, and is propagated up the | |
10 | window hierarchy until the event is processed or there are no more event handlers. | |
11 | The application should call wxEvent::GetId to check the identity of the clicked-on window, | |
12 | and then either show some suitable help or call wxEvent::Skip if the identifier is unrecognised. | |
fc2171bd | 13 | Calling Skip is important because it allows wxWidgets to generate further events for ancestors |
0460407f JS |
14 | of the clicked-on window. Otherwise it would be impossible to show help for container windows, |
15 | since processing would stop after the first window found. | |
16 | ||
17 | \wxheading{Derived from} | |
18 | ||
19 | \helpref{wxCommandEvent}{wxcommandevent}\\ | |
20 | \helpref{wxEvent}{wxevent}\\ | |
21 | \helpref{wxObject}{wxobject} | |
22 | ||
23 | \wxheading{Include files} | |
24 | ||
25 | <wx/event.h> | |
26 | ||
f2f8871a VZ |
27 | \wxheading{Help event origin}\label{wxhelpeventorigin} |
28 | ||
29 | Use \helpref{wxHelpEvent::GetOrigin}{wxhelpeventgetorigin} to determine the origin of this help event, | |
30 | it could be one of the following: | |
31 | ||
32 | \twocolwidtha{7cm} | |
33 | \begin{twocollist}\itemsep=0pt | |
34 | \twocolitem{{\bf Origin\_Unknown}}{Unrecognized event source.} | |
35 | \twocolitem{{\bf Origin\_Keyboard}}{Event generated by \texttt{F1} key press.} | |
36 | \twocolitem{{\bf Origin\_HelpButton}}{Event generated by | |
37 | \helpref{wxContextHelp}{wxcontexthelp} or using the "?" title bur button under | |
38 | MS Windows.} | |
39 | \end{twocollist}% | |
40 | ||
0460407f JS |
41 | \wxheading{Event table macros} |
42 | ||
43 | To process an activate event, use these event handler macros to direct input to a member | |
44 | function that takes a wxHelpEvent argument. | |
45 | ||
46 | \twocolwidtha{7cm} | |
47 | \begin{twocollist}\itemsep=0pt | |
48 | \twocolitem{{\bf EVT\_HELP(id, func)}}{Process a wxEVT\_HELP event.} | |
49 | \twocolitem{{\bf EVT\_HELP\_RANGE(id1, id2, func)}}{Process a wxEVT\_HELP event for a range of ids.} | |
50 | \end{twocollist}% | |
51 | ||
52 | \wxheading{See also} | |
53 | ||
54 | \helpref{wxContextHelp}{wxcontexthelp},\rtfsp | |
55 | \helpref{wxDialog}{wxdialog},\rtfsp | |
56 | \helpref{Event handling overview}{eventhandlingoverview} | |
57 | ||
58 | \latexignore{\rtfignore{\wxheading{Members}}} | |
59 | ||
f0e8a2d0 | 60 | \membersection{wxHelpEvent::wxHelpEvent}\label{wxhelpeventctor} |
0460407f | 61 | |
f6e9a818 | 62 | \func{}{wxHelpEvent}{\param{WXTYPE }{eventType = 0}, \param{wxWindowID }{id = 0}, |
0460407f JS |
63 | \param{const wxPoint\& }{point}} |
64 | ||
65 | Constructor. | |
66 | ||
f2f8871a VZ |
67 | \membersection{wxHelpEvent::GetOrigin}\label{wxhelpeventgetorigin} |
68 | ||
69 | \constfunc{wxHelpEvent::Origin }{GetOrigin}{\void} | |
70 | ||
71 | Returns the \helpref{origin}{wxhelpeventorigin} of the help event. This allows | |
72 | to determine the source of the event and show the appropriate help to the user. | |
73 | ||
74 | \wxheading{See also} | |
75 | ||
76 | \helpref{wxHelpEvent::SetOrigin}{wxhelpeventsetorigin}, \helpref{Help event origin}{wxhelpeventorigin} | |
77 | ||
78 | ||
0460407f JS |
79 | \membersection{wxHelpEvent::GetPosition}\label{wxhelpeventgetposition} |
80 | ||
81 | \constfunc{const wxPoint\&}{GetPosition}{\void} | |
82 | ||
83 | Returns the left-click position of the mouse, in screen coordinates. This allows | |
84 | the application to position the help appropriately. | |
85 | ||
f2f8871a VZ |
86 | \membersection{wxHelpEvent::SetOrigin}\label{wxhelpeventsetorigin} |
87 | ||
88 | \func{void}{SetOrigin}{\param{wxHelpEvent::Origin }{origin}} | |
89 | ||
90 | Set the help event \helpref{origin}{wxhelpeventorigin}. | |
91 | ||
92 | \wxheading{See also} | |
93 | ||
94 | \helpref{wxHelpEvent::GetOrigin}{wxhelpeventgetorigin}, \helpref{Help event origin}{wxhelpeventorigin} | |
95 | ||
96 | ||
0460407f JS |
97 | \membersection{wxHelpEvent::SetPosition}\label{wxhelpeventsetposition} |
98 | ||
99 | \func{void}{SetPosition}{\param{const wxPoint\&}{ pt}} | |
100 | ||
101 | Sets the left-click position of the mouse, in screen coordinates. | |
102 |