]>
Commit | Line | Data |
---|---|---|
0460407f JS |
1 | \section{\class{wxContextHelp}}\label{wxcontexthelp} |
2 | ||
3 | This class changes the cursor to a query and puts the application into a 'context-sensitive help mode'. | |
4 | When the user left-clicks on a window within the specified window, a wxEVT\_HELP event is | |
5 | sent to that control, and the application may respond to it by popping up some help. | |
6 | ||
7 | For example: | |
8 | ||
9 | \begin{verbatim} | |
10 | wxContextHelp contextHelp(myWindow); | |
11 | \end{verbatim} | |
12 | ||
7cb74906 JS |
13 | There are a couple of ways to invoke this behaviour implicitly: |
14 | ||
15 | \begin{itemize} | |
16 | \item Use the wxDIALOG\_EX\_CONTEXTHELP style for a dialog (Windows only). This will put a question mark | |
17 | in the titlebar, and Windows will put the application into context-sensitive help mode automatically, | |
18 | with further programming. | |
19 | \item Create a \helpref{wxContextHelpButton}{wxcontexthelpbutton}, whose predefined behaviour is to create a context help object. | |
20 | Normally you will write your application so that this button is only added to a dialog for non-Windows platforms | |
21 | (use wxDIALOG\_EX\_CONTEXTHELP on Windows). | |
22 | \end{itemize} | |
23 | ||
0460407f JS |
24 | \wxheading{Derived from} |
25 | ||
26 | \helpref{wxObject}{wxobject} | |
27 | ||
28 | \wxheading{Include files} | |
29 | ||
30 | <wx/cshelp.h> | |
31 | ||
32 | \wxheading{See also} | |
33 | ||
7cb74906 JS |
34 | \helpref{wxHelpEvent}{wxhelpevent}, |
35 | \helpref{wxHelpController}{wxhelpcontroller}, | |
36 | \helpref{wxContextHelpButton}{wxcontexthelpbutton} | |
0460407f JS |
37 | |
38 | \latexignore{\rtfignore{\wxheading{Members}}} | |
39 | ||
40 | \membersection{wxContextHelp::wxContextHelp} | |
41 | ||
cc81d32f | 42 | \func{}{wxContextHelp}{\param{wxWindow*}{ window = NULL}, \param{bool}{ doNow = true}} |
0460407f JS |
43 | |
44 | Constructs a context help object, calling \helpref{BeginContextHelp}{wxcontexthelpbegincontexthelp} if\rtfsp | |
cc81d32f | 45 | {\it doNow} is true (the default). |
0460407f JS |
46 | |
47 | If {\it window} is NULL, the top window is used. | |
48 | ||
49 | \membersection{wxContextHelp::\destruct{wxContextHelp}} | |
50 | ||
51 | \func{}{\destruct{wxContextHelp}}{\void} | |
52 | ||
53 | Destroys the context help object. | |
54 | ||
55 | \membersection{wxContextHelp::BeginContextHelp}\label{wxcontexthelpbegincontexthelp} | |
56 | ||
57 | \func{bool}{BeginContextHelp}{\param{wxWindow*}{ window = NULL}} | |
58 | ||
59 | Puts the application into context-sensitive help mode. {\it window} is the window | |
60 | which will be used to catch events; if NULL, the top window will be used. | |
61 | ||
cc81d32f | 62 | Returns true if the application was successfully put into context-sensitive help mode. |
0460407f JS |
63 | This function only returns when the event loop has finished. |
64 | ||
65 | \membersection{wxContextHelp::EndContextHelp}\label{wxcontexthelpendcontexthelp} | |
66 | ||
67 | \func{bool}{EndContextHelp}{\void} | |
68 | ||
69 | Ends context-sensitive help mode. Not normally called by the application. | |
70 | ||
7cb74906 JS |
71 | \section{\class{wxContextHelpButton}}\label{wxcontexthelpbutton} |
72 | ||
73 | Instances of this class may be used to add a question mark button that when pressed, puts the | |
74 | application into context-help mode. It does this by creating a \helpref{wxContextHelp}{wxcontexthelp} object which itself | |
75 | generates a wxEVT\_HELP event when the user clicks on a window. | |
76 | ||
77 | On Windows, you may add a question-mark icon to a dialog by use of the wxDIALOG\_EX\_CONTEXTHELP extra style, but | |
78 | on other platforms you will have to add a button explicitly, usually next to OK, Cancel or similar buttons. | |
79 | ||
80 | \wxheading{Derived from} | |
81 | ||
82 | \helpref{wxBitmapButton}{wxbitmapbutton}\\ | |
83 | \helpref{wxButton}{wxbutton}\\ | |
84 | \helpref{wxControl}{wxcontrol}\\ | |
85 | \helpref{wxWindow}{wxwindow}\\ | |
86 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
87 | \helpref{wxObject}{wxobject} | |
88 | ||
89 | \wxheading{Include files} | |
90 | ||
91 | <wx/cshelp.h> | |
92 | ||
93 | \wxheading{See also} | |
94 | ||
95 | \helpref{wxBitmapButton}{wxbitmapbutton}, \helpref{wxContextHelp}{wxcontexthelp} | |
96 | ||
97 | \latexignore{\rtfignore{\wxheading{Members}}} | |
98 | ||
99 | \membersection{wxContextHelpButton::wxContextHelpButton}\label{wxcontexthelpbuttonconstr} | |
100 | ||
101 | \func{}{wxContextHelpButton}{\void} | |
102 | ||
103 | Default constructor. | |
104 | ||
105 | \func{}{wxContextHelpButton}{ | |
106 | \param{wxWindow* }{parent}, | |
e7240349 | 107 | \param{wxWindowID }{id = wxID\_CONTEXT\_HELP}, |
7cb74906 JS |
108 | \param{const wxPoint\& }{pos = wxDefaultPosition}, |
109 | \param{const wxSize\& }{size = wxDefaultSize}, | |
110 | \param{long }{style = wxBU\_AUTODRAW}} | |
111 | ||
112 | Constructor, creating and showing a context help button. | |
113 | ||
114 | \wxheading{Parameters} | |
115 | ||
116 | \docparam{parent}{Parent window. Must not be NULL.} | |
117 | ||
118 | \docparam{id}{Button identifier. Defaults to wxID\_CONTEXT\_HELP.} | |
119 | ||
120 | \docparam{pos}{Button position.} | |
121 | ||
122 | \docparam{size}{Button size. If the default size (-1, -1) is specified then the button is sized | |
123 | appropriately for the question mark bitmap.} | |
124 | ||
125 | \docparam{style}{Window style.} | |
126 | ||
127 | \wxheading{Remarks} | |
128 | ||
129 | Normally you need pass only the parent window to the constructor, and use the defaults for the remaining parameters. | |
130 |