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