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