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