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