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