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