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