]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/helpinst.tex
Several changes and updates
[wxWidgets.git] / docs / latex / wx / helpinst.tex
... / ...
CommitLineData
1\section{\class{wxHelpController}}\label{wxhelpcontroller}
2
3This is a family of classes by which
4applications may invoke a help viewer to provide on-line help.
5
6A help controller allows an application to display help, at the contents
7or at a particular topic, and shut the help program down on termination.
8This avoids proliferation of many instances of the help viewer whenever the
9user requests a different topic via the application's menus or buttons.
10
11Typically, an application will create a help controller instance
12when it starts, and immediately call {\bf Initialize}\rtfsp
13to associate a filename with it. The help viewer will only get run, however,
14just before the first call to display something.
15
16Although all help controller classes actually derive from wxHelpControllerBase and have
17names of the form wxXXXHelpController, the
18appropriate class is aliased to the name wxHelpController for each platform.
19
20There are currently the following help controller classes defined:
21
22\begin{itemize}\itemsep=0pt
23\item wxWinHelpController, for controlling Windows Help.
24\item wxExtHelpController, for controlling external browsers under Unix.
25The default browser is Netscape Navigator.
26\item wxHelpControllerHtml, using wxHTML to display help
27\item wxXLPHelpController, for controlling wxHelp (from wxWindows 1).
28\end{itemize}
29
30\wxheading{Derived from}
31
32wxHelpControllerBase\\
33\helpref{wxObject}{wxobject}
34
35\wxheading{Include files}
36
37<wx/help.h> (wxWindows chooses the appropriate help controller class)\\
38<wx/helpbase.h> (wxHelpControllerBase class)\\
39<wx/helpwin.h> (Windows Help controller)\\
40<wx/generic/helpext.h> (external HTML browser controller)
41<wx/generic/helpwxht.h> (wxHTML based help controller)
42<wx/generic/helpxlp.h> (wxHelp controller)
43
44\latexignore{\rtfignore{\wxheading{Members}}}
45
46\membersection{wxHelpController::wxHelpController}
47
48\func{}{wxHelpController}{\void}
49
50Constructs a help instance object, but does not invoke the help viewer.
51
52\membersection{wxHelpController::\destruct{wxHelpController}}
53
54\func{}{\destruct{wxHelpController}}{\void}
55
56Destroys the help instance, closing down the viewer if it is running.
57
58\membersection{wxHelpController::Initialize}\label{wxhelpcontrollerinitialize}
59
60\func{virtual void}{Initialize}{\param{const wxString\& }{file}}
61
62\func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}}
63
64Initializes the help instance with a help filename, and optionally a server (socket)
65number if using wxHelp. Does not invoke the help viewer.
66This must be called directly after the help instance object is created and before
67any attempts to communicate with the viewer.
68
69You may omit the file extension and a suitable one will be chosen.
70
71\membersection{wxHelpController::DisplayBlock}\label{wxhelpcontrollerdisplayblock}
72
73\func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}}
74
75If the help viewer is not running, runs it and displays the file at the given block number.
76
77{\it wxHelp:} this is the wxHelp block number.
78
79{\it WinHelp:} Refers to the context number.
80
81{\it External HTML help:} the same as for \helpref{wxHelpController::DisplaySection}{wxhelpcontrollerdisplaysection}.
82
83\membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents}
84
85\func{virtual bool}{DisplayContents}{\void}
86
87If the help viewer is not running, runs it and displays the
88contents.
89
90\membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection}
91
92\func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}}
93
94If the help viewer is not running, runs it and displays the given section.
95
96{\it wxHelp:} Sections are numbered starting from 1. Section numbers may be viewed by running wxHelp in edit mode.
97
98{\it WinHelp:} {\it sectionNo} is a context id.
99
100{\it External HTML help/wxHTML based help:} wxExtHelpController and wxHelpControllerHtml implement {\it sectionNo} as an id in a map file, which is of the form:
101
102\begin{verbatim}
1030 wx.html ; Index
1041 wx34.html#classref ; Class reference
1052 wx204.html ; Function reference
106\end{verbatim}
107
108\membersection{wxHelpController::KeywordSearch}\label{wxhelpcontrollerkeywordsearch}
109
110\func{virtual bool}{KeywordSearch}{\param{const wxString\& }{keyWord}}
111
112If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one
113match is found, the file is displayed at this section.
114
115{\it wxHelp:} If more than one
116match is found, the Search dialog is displayed with the matches.
117
118{\it WinHelp:} If more than one match is found,
119the first topic is displayed.
120
121{\it External HTML help:} If more than one match is found,
122a choice of topics is displayed.
123
124\membersection{wxHelpController::LoadFile}\label{wxhelpcontrollerloadfile}
125
126\func{virtual bool}{LoadFile}{\param{const wxString\& }{file = ""}}
127
128If the help viewer is not running, runs it and loads the given file.
129If the filename is not supplied or is
130NULL, the file specified in {\bf Initialize} is used. If the viewer is
131already displaying the specified file, it will not be reloaded. This
132member function may be used before each display call in case the user
133has opened another file.
134
135\membersection{wxHelpController::SetViewer}\label{wxhelpcontrollersetviewer}
136
137\func{virtual void}{SetViewer}{\param{const wxString\& }{viewer}, \param{long}{ flags}}
138
139Sets detailed viewer information. So far this is only relevant to wxExtHelpController.
140
141\membersection{wxHelpController::SetFrameParameters}\label{wxhelpcontrollersetframeparameters}
142\func{virtual void}{SetFrameParameters}
143{\param{const wxString \& }{title},
144 \param{const wxSize \& }{size}, \param{const wxPoint \& }{pos = wxDefaultPosition},
145 \param{bool }{newFrameEachTime = FALSE}}
146
147For the wxHelpControllerHtml, this allows the application to set the
148default frame title, size and position for the frame. If the title
149contains \%s, this will be replaced with the page title. If the
150parammeter newFrameEachTime is set, the controller will open a new
151help frame each time it is called. For all other help controllers this
152function has no effect.
153
154\membersection{wxHelpController::GetFrameParameters}\label{wxhelpcontrollergetframeparameters}
155\func{virtual wxFrame *}{GetFrameParameters}
156{\param{const wxSize * }{size = NULL}, \param{const wxPoint * }{pos = NULL},
157 \param{bool *}{newFrameEachTime = NULL}}
158This reads the current settings for the help frame in the case of the
159wxHelpControllerHtml, setting the frame size, position and
160the newFrameEachTime parameters to the last values used. It also
161returns the pointer to the last opened help frame. This can be used
162for example, to automatically close the help frame on program
163shutdown. For all other help controllers, this function does nothing
164and just returns NULL.
165
166\wxheading{Parameters}
167
168\docparam{viewer}{This defaults to "netscape" for wxExtHelpController.}
169
170\docparam{flags}{This defaults to wxHELP\_NETSCAPE for wxExtHelpController, indicating
171that the viewer is a variant of Netscape Navigator.}
172
173\membersection{wxHelpController::OnQuit}\label{wxhelpcontrolleronquit}
174
175\func{virtual bool}{OnQuit}{\void}
176
177Overridable member called when this application's viewer is quit by the user.
178
179This does not work for all help controllers.
180
181\membersection{wxHelpController::Quit}\label{wxhelpcontrollerquit}
182
183\func{virtual bool}{Quit}{\void}
184
185If the viewer is running, quits it by disconnecting.
186
187For Windows Help, the viewer will only close if no other application is using it.
188