]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/helpinst.tex
More asserts and stuff
[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 wxXLPHelpController, for controlling wxHelp (from wxWindows 1).
27\end{itemize}
28
29\wxheading{Derived from}
30
31wxHelpControllerBase\\
32\helpref{wxObject}{wxobject}
33
34\wxheading{Include files}
35
36<wx/help.h> (wxWindows chooses the appropriate help controller class)\\
37<wx/helpbase.h> (wxHelpControllerBase class)\\
38<wx/helpwin.h> (Windows Help controller)\\
39<wx/generic/helpext.h> (external HTML browser controller)
40<wx/generic/helpxlp.h> (wxHelp controller)
41
42\latexignore{\rtfignore{\wxheading{Members}}}
43
44\membersection{wxHelpController::wxHelpController}
45
46\func{}{wxHelpController}{\void}
47
48Constructs a help instance object, but does not invoke the help viewer.
49
50\membersection{wxHelpController::\destruct{wxHelpController}}
51
52\func{}{\destruct{wxHelpController}}{\void}
53
54Destroys the help instance, closing down the viewer if it is running.
55
56\membersection{wxHelpController::Initialize}\label{wxhelpcontrollerinitialize}
57
58\func{virtual void}{Initialize}{\param{const wxString\& }{file}}
59
60\func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}}
61
62Initializes the help instance with a help filename, and optionally a server (socket)
63number if using wxHelp. Does not invoke the help viewer.
64This must be called directly after the help instance object is created and before
65any attempts to communicate with the viewer.
66
67You may omit the file extension and a suitable one will be chosen.
68
69\membersection{wxHelpController::DisplayBlock}\label{wxhelpcontrollerdisplayblock}
70
71\func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}}
72
73If the help viewer is not running, runs it and displays the file at the given block number.
74
75{\it wxHelp:} this is the wxHelp block number.
76
77{\it WinHelp:} Refers to the context number.
78
79{\it External HTML help:} the same as for \helpref{wxHelpController::DisplaySection}{wxhelpcontrollerdisplaysection}.
80
81\membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents}
82
83\func{virtual bool}{DisplayContents}{\void}
84
85If the help viewer is not running, runs it and displays the
86contents.
87
88\membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection}
89
90\func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}}
91
92If the help viewer is not running, runs it and displays the given section.
93
94{\it wxHelp:} Sections are numbered starting from 1. Section numbers may be viewed by running wxHelp in edit mode.
95
96{\it WinHelp:} {\it sectionNo} is a context id.
97
98{\it External HTML help:} wxExtHelpController implements {\it sectionNo} as an id in a map file, which is of the form:
99
100\begin{verbatim}
1010 wx.html ; Index
1021 wx34.html#classref ; Class reference
1032 wx204.html ; Function reference
104\end{verbatim}
105
106\membersection{wxHelpController::KeywordSearch}\label{wxhelpcontrollerkeywordsearch}
107
108\func{virtual bool}{KeywordSearch}{\param{const wxString\& }{keyWord}}
109
110If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one
111match is found, the file is displayed at this section.
112
113{\it wxHelp:} If more than one
114match is found, the Search dialog is displayed with the matches.
115
116{\it WinHelp:} If more than one match is found,
117the first topic is displayed.
118
119{\it External HTML help:} If more than one match is found,
120a choice of topics is displayed.
121
122\membersection{wxHelpController::LoadFile}\label{wxhelpcontrollerloadfile}
123
124\func{virtual bool}{LoadFile}{\param{const wxString\& }{file = ""}}
125
126If the help viewer is not running, runs it and loads the given file.
127If the filename is not supplied or is
128NULL, the file specified in {\bf Initialize} is used. If the viewer is
129already displaying the specified file, it will not be reloaded. This
130member function may be used before each display call in case the user
131has opened another file.
132
133\membersection{wxHelpController::SetViewer}\label{wxhelpcontrollersetviewer}
134
135\func{virtual void}{SetViewer}{\param{const wxString\& }{viewer}, \param{long}{ flags}}
136
137Sets detailed viewer information. So far this is only relevant to wxExtHelpController.
138
139\wxheading{Parameters}
140
141\docparam{viewer}{This defaults to "netscape" for wxExtHelpController.}
142
143\docparam{flags}{This defaults to wxHELP\_NETSCAPE for wxExtHelpController, indicating
144that the viewer is a variant of Netscape Navigator.}
145
146\membersection{wxHelpController::OnQuit}\label{wxhelpcontrolleronquit}
147
148\func{virtual bool}{OnQuit}{\void}
149
150Overridable member called when this application's viewer is quit by the user.
151
152This does not work for all help controllers.
153
154\membersection{wxHelpController::Quit}\label{wxhelpcontrollerquit}
155
156\func{virtual bool}{Quit}{\void}
157
158If the viewer is running, quits it by disconnecting.
159
160For Windows Help, the viewer will only close if no other application is using it.
161