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