]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/hthelpct.tex
wxHtmlHelpController now accepts AddBook('archive.zip') and zip archive may contain...
[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
b32c6ff0 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
22You can use tex2rtf to generate MHHW projects (see wxHTML homepage for details).
23
24In order to use the controller in your application under Windows you must
448af9a4 25have the following line in your .rc file:
704a4b75
VS
26
27\begin{verbatim}
28#include "wx/html/msw/wxhtml.rc"
29\end{verbatim}
30
704a4b75
VS
31\wxheading{Derived from}
32
33wxEvtHandler
34
704a4b75
VS
35\latexignore{\rtfignore{\wxheading{Members}}}
36
704a4b75
VS
37\membersection{wxHtmlHelpController::wxHtmlHelpController}\label{wxhtmlhelpcontrollerwxhtmlhelpcontroller}
38
09397bc6 39\func{}{wxHtmlHelpController}{\param{int }{style = wxHF_DEFAULTSTYLE}}
704a4b75 40
704a4b75
VS
41Constructor.
42
09397bc6
VS
43\wxheading{Parameters}
44
45{\it style} is combination of these flags:
46
47\begin{twocollist}
48\twocolitem{\windowstyle{wxHF\_TOOLBAR}}{Help frame has toolbar.}
49\twocolitem{\windowstyle{wxHF\_CONTENTS}}{Help frame has contents panel.}
50\twocolitem{\windowstyle{wxHF\_INDEX}}{Help frame has index panel.}
51\twocolitem{\windowstyle{wxHF\_SEARCH}}{Help frame has search panel.}
52\end{twocollist}
53
54Default value : everything enabled.
55
704a4b75
VS
56\membersection{wxHtmlHelpController::AddBook}\label{wxhtmlhelpcontrolleraddbook}
57
58\func{bool}{AddBook}{\param{const wxString\& }{book}, \param{bool }{show_wait_msg}}
59
60Adds book (\helpref{.hhp file}{helpformat} - HTML Help Workshop project file) into the list of loaded books.
61This must be called at least once before displaying any help.
62
3dabc03f
VS
63{\it book} may be either .hhp file or ZIP archive that contains arbitrary number of .hhp files in
64top-level directory. This ZIP archive must have .zip or .htb extension
65(the latter stands for "HTML book"). In other words, {\tt AddBook("help.zip")} is possible and, in fact,
66recommended way.
67
448af9a4 68If {\it show\_wait\_msg} is TRUE then a decorationless window with progress message is displayed.
704a4b75 69
704a4b75
VS
70\membersection{wxHtmlHelpController::Display}\label{wxhtmlhelpcontrollerdisplay}
71
72\func{void}{Display}{\param{const wxString\& }{x}}
73
74Displays page {\it x}. This is THE important function - it is used to display
75the help in application.
76
77You can specify the page in many ways:
78
448af9a4 79\begin{itemize}\itemsep=0pt
704a4b75
VS
80\item as direct filename of HTML document
81\item as chapter name (from contents) or as a book name
82\item as some word from index
b32c6ff0 83\item even as any word (will be searched)
704a4b75
VS
84\end{itemize}
85
86Looking for the page runs in these steps:
87
448af9a4 88\begin{enumerate}\itemsep=0pt
704a4b75
VS
89\item try to locate file named x (if x is for example "doc/howto.htm")
90\item try to open starting page of book named x
91\item try to find x in contents (if x is for example "How To ...")
92\item try to find x in index (if x is for example "How To ...")
93\item switch to Search panel and start searching
94\end{enumerate}
95
96\func{void}{Display}{\param{const int }{id}}
97
98This alternative form is used to search help contents by numeric IDs.
99
b32c6ff0
RD
100\pythonnote{The second form of this method is named DisplayId in
101wxPython.}
102
704a4b75
VS
103\membersection{wxHtmlHelpController::DisplayContents}\label{wxhtmlhelpcontrollerdisplaycontents}
104
105\func{void}{DisplayContents}{\void}
106
107Displays help window and focuses contents panel.
108
109\membersection{wxHtmlHelpController::DisplayIndex}\label{wxhtmlhelpcontrollerdisplayindex}
110
111\func{void}{DisplayIndex}{\void}
112
113Displays help window and focuses index panel.
114
704a4b75
VS
115\membersection{wxHtmlHelpController::KeywordSearch}\label{wxhtmlhelpcontrollerkeywordsearch}
116
117\func{bool}{KeywordSearch}{\param{const wxString\& }{keyword}}
118
119Displays help window, focuses search panel and starts searching.
120Returns TRUE if the keyword was found.
121
448af9a4
JS
122{\bf Important:} KeywordSearch searches only pages listed in .htc file(s).
123You should list all pages in the contents file.
704a4b75 124
559fe022
VS
125\membersection{wxHtmlHelpController::ReadCustomization}\label{wxhtmlhelpcontrollerreadcustomization}
126
127\func{void}{ReadCustomization}{\param{wxConfigBase* }{cfg}, \param{wxString }{path = wxEmptyString}}
128
448af9a4 129Reads the controller's setting (position of window, etc.)
559fe022
VS
130
131\membersection{wxHtmlHelpController::SetTempDir}\label{wxhtmlhelpcontrollersettempdir}
132
133\func{void}{SetTempDir}{\param{const wxString\& }{path}}
134
448af9a4
JS
135Sets the path for storing temporary files - cached binary versions of index and contents files. These binary
136forms are much faster to read. Default value is empty string (empty string means
b32c6ff0 137that no cached data are stored). Note that these files are {\it not}
448af9a4 138deleted when program exits.
559fe022
VS
139
140\membersection{wxHtmlHelpController::SetTitleFormat}\label{wxhtmlhelpcontrollersettitleformat}
141
142\func{void}{SetTitleFormat}{\param{const wxString\& }{format}}
143
144Sets format of title of the frame. Must contain exactly one "\%s"
145(for title of displayed HTML page).
146
704a4b75
VS
147\membersection{wxHtmlHelpController::UseConfig}\label{wxhtmlhelpcontrolleruseconfig}
148
149\func{void}{UseConfig}{\param{wxConfigBase* }{config}, \param{const wxString\& }{rootpath = wxEmptyString}}
150
151Associates {\it config} object with the controller.
152
153If there is associated config object, wxHtmlHelpController automatically
154reads and writes settings (including wxHtmlWindow's settings) when needed.
155
b32c6ff0 156The only thing you must do is create wxConfig object and call UseConfig.
704a4b75 157
704a4b75
VS
158\membersection{wxHtmlHelpController::WriteCustomization}\label{wxhtmlhelpcontrollerwritecustomization}
159
160\func{void}{WriteCustomization}{\param{wxConfigBase* }{cfg}, \param{wxString }{path = wxEmptyString}}
161
162Stores controllers setting (position of window etc.)
163