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