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