]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/helpinst.tex
cvs debugging
[wxWidgets.git] / docs / latex / wx / helpinst.tex
CommitLineData
6fb26ea3 1\section{\class{wxHelpController}}\label{wxhelpcontroller}
a660d684 2
6fb26ea3 3This is a family of classes by which
fe604ccd 4applications may invoke a help viewer to provide on-line help.
a660d684 5
fe604ccd
JS
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.
a660d684 10
fe604ccd
JS
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.
a660d684 15
6b037754
JS
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.
a660d684 19
6fb26ea3 20There are currently the following help controller classes defined:
a660d684 21
2432b92d 22\begin{itemize}\itemsep=0pt
6fb26ea3
JS
23\item wxWinHelpController, for controlling Windows Help.
24\item wxExtHelpController, for controlling external browsers under Unix.
25The default browser is Netscape Navigator.
db8db70a 26\item wxHelpControllerHtml, using wxHTML to display help
33b64e6f 27\item wxXLPHelpController, for controlling wxHelp (from wxWindows 1).
6fb26ea3 28\end{itemize}
a660d684 29
954b8ae6 30\wxheading{Derived from}
a660d684 31
6fb26ea3
JS
32wxHelpControllerBase\\
33\helpref{wxObject}{wxobject}
fe604ccd 34
954b8ae6 35\wxheading{Include files}
a660d684 36
dbdb39b2
JS
37<wx/help.h> (wxWindows chooses the appropriate help controller class)\\
38<wx/helpbase.h> (wxHelpControllerBase class)\\
39<wx/helpwin.h> (Windows Help controller)\\
33b64e6f 40<wx/generic/helpext.h> (external HTML browser controller)
db8db70a 41<wx/generic/helpwxht.h> (wxHTML based help controller)
33b64e6f 42<wx/generic/helpxlp.h> (wxHelp controller)
a660d684
KB
43
44\latexignore{\rtfignore{\wxheading{Members}}}
45
6fb26ea3 46\membersection{wxHelpController::wxHelpController}
a660d684 47
6fb26ea3 48\func{}{wxHelpController}{\void}
a660d684 49
fe604ccd 50Constructs a help instance object, but does not invoke the help viewer.
a660d684 51
6fb26ea3 52\membersection{wxHelpController::\destruct{wxHelpController}}
a660d684 53
6fb26ea3 54\func{}{\destruct{wxHelpController}}{\void}
a660d684 55
fe604ccd 56Destroys the help instance, closing down the viewer if it is running.
a660d684 57
6fb26ea3 58\membersection{wxHelpController::Initialize}\label{wxhelpcontrollerinitialize}
a660d684 59
fe604ccd
JS
60\func{virtual void}{Initialize}{\param{const wxString\& }{file}}
61
62\func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}}
a660d684
KB
63
64Initializes the help instance with a help filename, and optionally a server (socket)
33b64e6f 65number if using wxHelp. Does not invoke the help viewer.
a660d684 66This must be called directly after the help instance object is created and before
fe604ccd
JS
67any attempts to communicate with the viewer.
68
69You may omit the file extension and a suitable one will be chosen.
a660d684 70
6fb26ea3 71\membersection{wxHelpController::DisplayBlock}\label{wxhelpcontrollerdisplayblock}
a660d684 72
fe604ccd 73\func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}}
a660d684 74
fe604ccd 75If the help viewer is not running, runs it and displays the file at the given block number.
33b64e6f
JS
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}.
a660d684 82
6fb26ea3 83\membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents}
a660d684 84
fe604ccd 85\func{virtual bool}{DisplayContents}{\void}
a660d684 86
fe604ccd
JS
87If the help viewer is not running, runs it and displays the
88contents.
a660d684 89
6fb26ea3 90\membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection}
a660d684 91
fe604ccd 92\func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}}
a660d684 93
fe604ccd 94If the help viewer is not running, runs it and displays the given section.
a660d684 95
33b64e6f
JS
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.
a660d684 99
db8db70a 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:
33b64e6f
JS
101
102\begin{verbatim}
1030 wx.html ; Index
1041 wx34.html#classref ; Class reference
1052 wx204.html ; Function reference
106\end{verbatim}
a660d684 107
6fb26ea3 108\membersection{wxHelpController::KeywordSearch}\label{wxhelpcontrollerkeywordsearch}
a660d684 109
fe604ccd
JS
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
33b64e6f
JS
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.
a660d684 123
6fb26ea3 124\membersection{wxHelpController::LoadFile}\label{wxhelpcontrollerloadfile}
a660d684 125
33b64e6f 126\func{virtual bool}{LoadFile}{\param{const wxString\& }{file = ""}}
a660d684 127
fe604ccd
JS
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
a660d684
KB
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
33b64e6f
JS
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
db8db70a
KB
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
33b64e6f
JS
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
6fb26ea3 173\membersection{wxHelpController::OnQuit}\label{wxhelpcontrolleronquit}
fe604ccd
JS
174
175\func{virtual bool}{OnQuit}{\void}
a660d684 176
fe604ccd 177Overridable member called when this application's viewer is quit by the user.
a660d684 178
6fb26ea3 179This does not work for all help controllers.
a660d684 180
6fb26ea3 181\membersection{wxHelpController::Quit}\label{wxhelpcontrollerquit}
a660d684 182
fe604ccd 183\func{virtual bool}{Quit}{\void}
a660d684 184
fe604ccd 185If the viewer is running, quits it by disconnecting.
a660d684 186
fe604ccd 187For Windows Help, the viewer will only close if no other application is using it.
a660d684 188