]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/hthelpct.tex
Removed OGL prior to re-adding; some Watcom corrections
[wxWidgets.git] / docs / latex / wx / hthelpct.tex
... / ...
CommitLineData
1%
2% automatically generated by HelpGen from
3% htmlhelp.h at 02/May/99 19:58:53
4%
5
6\section{\class{wxHtmlHelpController}}\label{wxhtmlhelpcontroller}
7
8{\bf WARNING! This help controller has an API incompatible with wxWindows
9wxHelpController!}
10
11This help controller provides an easy way of displaying HTML help in your
12application (see {\it test} sample). The help system is based on {\bf books}
13(see \helpref{AddBook}{wxhtmlhelpcontrolleraddbook}). A book is a logical
14section of documentation (for example "User's Guide" or "Programmer's Guide" or
15"C++ Reference" or "wxWindows Reference"). The help controller can handle as
16many books as you want.
17
18wxHTML uses Microsoft's HTML Help Workshop project files (.hhp, .hhk, .hhc) as its
19native format. The file format is described \helpref{here}{helpformat}.
20Have a look at docs/html/ directory where sample project files are stored.
21
22You can use Tex2RTF to produce these files when generating HTML, if you set {\bf htmlWorkshopFiles} to {\bf true} in
23your tex2rtf.ini file.
24
25In order to use the controller in your application under Windows you must
26have the following line in your .rc file:
27
28\begin{verbatim}
29#include "wx/html/msw/wxhtml.rc"
30\end{verbatim}
31
32\wxheading{Note}
33
34It is strongly recommended to use preprocessed {\bf .hhp.cached} version of
35projects. It can be either created on-the-fly (see
36\helpref{SetTempDir}{wxhtmlhelpcontrollersettempdir}) or you can use
37{\bf hhp2cached} utility from {\it utils/hhp2cached} to create it and
38distribute the cached version together with helpfiles. See {\it samples/html/help}
39sample for demonstration of its use.
40
41\wxheading{Derived from}
42
43\helpref{wxEvtHandler}{wxevthandler}
44
45\wxheading{Include files}
46
47<wx/html/helpctrl.h>
48
49
50\latexignore{\rtfignore{\wxheading{Members}}}
51
52\membersection{wxHtmlHelpController::wxHtmlHelpController}\label{wxhtmlhelpcontrollerwxhtmlhelpcontroller}
53
54\func{}{wxHtmlHelpController}{\param{int }{style = wxHF\_DEFAULTSTYLE}}
55
56Constructor.
57
58\wxheading{Parameters}
59
60{\it style} is combination of these flags:
61
62\begin{twocollist}
63\twocolitem{\windowstyle{wxHF\_TOOLBAR}}{Help frame has toolbar.}
64\twocolitem{\windowstyle{wxHF\_CONTENTS}}{Help frame has contents panel.}
65\twocolitem{\windowstyle{wxHF\_INDEX}}{Help frame has index panel.}
66\twocolitem{\windowstyle{wxHF\_SEARCH}}{Help frame has search panel.}
67\twocolitem{\windowstyle{wxHF\_BOOKMARKS}}{Help frame has bookmarks controls.}
68\twocolitem{\windowstyle{wxHF\_OPENFILES}}{Allow user to open arbitrary HTML document.}
69\twocolitem{\windowstyle{wxHF\_PRINT}}{Toolbar contains "print" button.}
70\end{twocollist}
71
72Default value: everything but wxHF\_OPENFILES enabled.
73
74\membersection{wxHtmlHelpController::AddBook}\label{wxhtmlhelpcontrolleraddbook}
75
76\func{bool}{AddBook}{\param{const wxString\& }{book}, \param{bool }{show\_wait\_msg}}
77
78Adds book (\helpref{.hhp file}{helpformat} - HTML Help Workshop project file) into the list of loaded books.
79This must be called at least once before displaying any help.
80
81{\it book} may be either .hhp file or ZIP archive that contains arbitrary number of .hhp files in
82top-level directory. This ZIP archive must have .zip or .htb extension
83(the latter stands for "HTML book"). In other words, {\tt AddBook("help.zip")} is possible and, in fact,
84recommended way.
85
86If {\it show\_wait\_msg} is TRUE then a decorationless window with progress message is displayed.
87
88\membersection{wxHtmlHelpController::Display}\label{wxhtmlhelpcontrollerdisplay}
89
90\func{void}{Display}{\param{const wxString\& }{x}}
91
92Displays page {\it x}. This is THE important function - it is used to display
93the help in application.
94
95You can specify the page in many ways:
96
97\begin{itemize}\itemsep=0pt
98\item as direct filename of HTML document
99\item as chapter name (from contents) or as a book name
100\item as some word from index
101\item even as any word (will be searched)
102\end{itemize}
103
104Looking for the page runs in these steps:
105
106\begin{enumerate}\itemsep=0pt
107\item try to locate file named x (if x is for example "doc/howto.htm")
108\item try to open starting page of book named x
109\item try to find x in contents (if x is for example "How To ...")
110\item try to find x in index (if x is for example "How To ...")
111\item switch to Search panel and start searching
112\end{enumerate}
113
114\func{void}{Display}{\param{const int }{id}}
115
116This alternative form is used to search help contents by numeric IDs.
117
118\pythonnote{The second form of this method is named DisplayId in
119wxPython.}
120
121\membersection{wxHtmlHelpController::DisplayContents}\label{wxhtmlhelpcontrollerdisplaycontents}
122
123\func{void}{DisplayContents}{\void}
124
125Displays help window and focuses contents panel.
126
127\membersection{wxHtmlHelpController::DisplayIndex}\label{wxhtmlhelpcontrollerdisplayindex}
128
129\func{void}{DisplayIndex}{\void}
130
131Displays help window and focuses index panel.
132
133\membersection{wxHtmlHelpController::KeywordSearch}\label{wxhtmlhelpcontrollerkeywordsearch}
134
135\func{bool}{KeywordSearch}{\param{const wxString\& }{keyword}}
136
137Displays help window, focuses search panel and starts searching.
138Returns TRUE if the keyword was found.
139
140{\bf Important:} KeywordSearch searches only pages listed in .htc file(s).
141You should list all pages in the contents file.
142
143\membersection{wxHtmlHelpController::ReadCustomization}\label{wxhtmlhelpcontrollerreadcustomization}
144
145\func{void}{ReadCustomization}{\param{wxConfigBase* }{cfg}, \param{wxString }{path = wxEmptyString}}
146
147Reads the controller's setting (position of window, etc.)
148
149\membersection{wxHtmlHelpController::SetTempDir}\label{wxhtmlhelpcontrollersettempdir}
150
151\func{void}{SetTempDir}{\param{const wxString\& }{path}}
152
153Sets the path for storing temporary files - cached binary versions of index and contents files. These binary
154forms are much faster to read. Default value is empty string (empty string means
155that no cached data are stored). Note that these files are {\it not}
156deleted when program exits.
157
158Once created these cached files will be used in all subsequent executions
159of your application. If cached files become older than corresponding .hhp
160file (e.g. if you regenerate documentation) it will be refreshed.
161
162\membersection{wxHtmlHelpController::SetTitleFormat}\label{wxhtmlhelpcontrollersettitleformat}
163
164\func{void}{SetTitleFormat}{\param{const wxString\& }{format}}
165
166Sets format of title of the frame. Must contain exactly one "\%s"
167(for title of displayed HTML page).
168
169\membersection{wxHtmlHelpController::UseConfig}\label{wxhtmlhelpcontrolleruseconfig}
170
171\func{void}{UseConfig}{\param{wxConfigBase* }{config}, \param{const wxString\& }{rootpath = wxEmptyString}}
172
173Associates {\it config} object with the controller.
174
175If there is associated config object, wxHtmlHelpController automatically
176reads and writes settings (including wxHtmlWindow's settings) when needed.
177
178The only thing you must do is create wxConfig object and call UseConfig.
179
180If you do not use {\it UseConfig}, wxHtmlHelpController will use
181default wxConfig object if available (for details see
182\helpref{wxConfigBase::Get}{wxconfigbaseget} and
183\helpref{wxConfigBase::Set}{wxconfigbaseset}).
184
185\membersection{wxHtmlHelpController::WriteCustomization}\label{wxhtmlhelpcontrollerwritecustomization}
186
187\func{void}{WriteCustomization}{\param{wxConfigBase* }{cfg}, \param{wxString }{path = wxEmptyString}}
188
189Stores controllers setting (position of window etc.)
190
191\membersection{wxHtmlHelpController::CreateHelpFrame}\label{wxhtmlhelpcontrollercreatehelpframe}
192
193\func{virtual wxHtmlHelpFrame*}{CreateHelpFrame}{\param{wxHtmlHelpData * }{data}}
194
195This protected virtual method may be overriden so that the controller
196uses slightly different frame. See {\it samples/html/helpview} sample for
197an example.
198
199