]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/htwindow.tex
initial commit
[wxWidgets.git] / docs / latex / wx / htwindow.tex
1 %
2 % automatically generated by HelpGen from
3 % htmlwindow.tex at 14/Mar/99 20:13:37
4 %
5
6
7 \section{\class{wxHtmlWindow}}\label{wxhtmlwindow}
8
9 wxHtmlWindow is probably the only class you will directly use
10 unless you want to do something special (like adding new tag
11 handlers or MIME filters)
12
13 Purpose of this class is to display HTML page (either local
14 file or downloaded via HTTP protocol) in a window. Width
15 of window is constant - given in constructor - virtual height
16 is changed dynamicly depending on page size.
17 Once the window is created you can set it's content by calling
18 \helpref{SetPage(text)}{wxhtmlwindowsetpage} or
19 \helpref{LoadPage(filename)}{wxhtmlwindowloadpage}.
20
21
22 \wxheading{Derived from}
23
24 wxScrolledWindow
25
26 \wxheading{Include files}
27
28 <wxhtml/wxhtmlwin.h>
29
30 \membersection{wxHtmlWindow::wxHtmlWindow}\label{wxhtmlwindowwxhtmlwindow}
31
32 \func{}{wxHtmlWindow}{\void}
33
34 Default constructor.
35
36 \func{}{wxHtmlWindow}{\param{wxWindow }{*parent}, \param{wxWindowID }{id = -1}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{const wxString\& }{name = "htmlWindow"}, \param{bool }{scrollable = TRUE}}
37
38 Constructor. The parameters are same as in wxScrollWindow ctor.
39 (Too lazy to document it once again... :-)
40
41 \wxheading{Parameters}
42
43 \docparam{scrollable}{if false then no scrollbars are displayed, even if size of page is larger than window size}
44
45
46
47 \membersection{wxHtmlWindow::SetPage}\label{wxhtmlwindowsetpage}
48
49 \func{bool}{SetPage}{\param{const wxString\& }{source}}
50
51 Sets HTML page and display it. This won't {\bf load} the page!!
52 It will display the {\it source}. See example:
53
54 \begin{verbatim}
55 htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
56 \end{verbatim}
57
58 If you want to load document from some location use
59 \helpref{LoadPage}{wxhtmlwindowloadpage} instead.
60
61 \wxheading{Parameters}
62
63 \docparam{source}{The HTML document source to be displayed.}
64
65
66 \wxheading{Return value}
67
68 FALSE if an error occured, TRUE otherwise
69
70 \membersection{wxHtmlWindow::LoadPage}\label{wxhtmlwindowloadpage}
71
72 \func{bool}{LoadPage}{\param{const wxString\& }{location}}
73
74 Unlike SetPage this function first loads HTML page from {\it location}
75 and then displays it. See example:
76
77 \begin{verbatim}
78 htmlwin -> SetPage("help/myproject/index.htm");
79 \end{verbatim}
80
81 \wxheading{Parameters}
82
83 \docparam{location}{The address of document. See \helpref{wxFileSystem}{wxfilesystem} for details on address format and behaviour of "opener".}
84
85 \wxheading{Return value}
86
87 FALSE if an error occured, TRUE otherwise
88
89
90
91 \membersection{wxHtmlWindow::GetOpenedPage}\label{wxhtmlwindowgetopenedpage}
92
93 \func{wxString}{GetOpenedPage}{\void}
94
95 Returns full location of the opened page. If no page is opened or if the displayed page wasn't
96 produced by call to LoadPage, empty string is returned.
97
98
99
100 \membersection{wxHtmlWindow::SetRelatedFrame}\label{wxhtmlwindowsetrelatedframe}
101
102 \func{void}{SetRelatedFrame}{\param{wxFrame* }{frame}, \param{const wxString\& }{format}}
103
104 Sets frame in which page title will be displayed. {\it format} is format of
105 frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This
106 \%s is substituted with HTML page title.
107
108
109
110
111 \membersection{wxHtmlWindow::GetRelatedFrame}\label{wxhtmlwindowgetrelatedframe}
112
113 \constfunc{wxFrame*}{GetRelatedFrame}{\void}
114
115 Returns the related frame.
116
117
118 \membersection{wxHtmlWindow::SetRelatedStatusBar}\label{wxhtmlwindowsetrelatedstatusbar}
119
120 \func{void}{SetRelatedStatusBar}{\param{int }{bar}}
121
122 {\bf After} calling \helpref{SetRelatedFrame}{wxhtmlwindowsetrelatedframe},
123 this sets statusbar slot where messages will be displayed.
124 (Default is -1 = no messages.)
125
126 \wxheading{Parameters}
127
128 \docparam{bar}{statusbar slot number (0..n)}
129
130 \membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts}
131
132 \func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{int }{normal\_italic\_mode}, \param{wxString }{fixed\_face}, \param{int }{fixed\_italic\_mode}, \param{int }{*sizes}}
133
134 This function sets font sizes and faces.
135
136 \wxheading{Parameters}
137
138 \docparam{normal_face}{This is face name for normal (i.e. non-fixed) font.
139 It can be either empty string (then the default face is choosen) or
140 platform-specific face name. Examples are "helvetica" under Unix or
141 "Times New Roman" under Windows.}
142
143 \docparam{normal_italic_mode}{This is either wxSLANT or wxITALIC.
144 It determines how
145 italic (<I>..</I>) text is handled. See wxFont documentation for
146 details. For example you should use wxSLANT in conjuction with
147 "helvetica" face or wxITALIC with "times" face.}
148
149 \docparam{fixed_face}{The same thing for fixed face ( <TT>..</TT> )}
150
151 \docparam{fixed_italic_mode}{The same thing for fixed face.}
152
153 \docparam{sizes}{This is an array of 7 items of {\it int} type.
154 The values represent size of font with HTML size from -2 to +4
155 ( <FONT SIZE=-2> to <FONT SIZE=+4> )}
156
157 \wxheading{Defaults}
158
159 Under wxGTK:
160
161 \begin{verbatim}
162 SetFonts("", wxSLANT, "", wxSLANT, {10, 12, 14, 16, 19, 24, 32});
163 \end{verbatim}
164
165 Under Windows:
166
167 \begin{verbatim}
168 SetFonts("", wxSLANT, "", wxSLANT, {7, 8, 10, 12, 16, 22, 30});
169 \end{verbatim}
170
171 Athough it seems different the fact is that the fonts are of approximately
172 same size under both platforms (due to wxMSW / wxGTK inconsistency)
173
174
175 \membersection{wxHtmlWindow::SetBorders}\label{wxhtmlwindowsetborders}
176
177 \func{void}{SetBorders}{\param{int }{b}}
178
179 This function sets the space between border of window and HTML contents. See image:
180
181 \image{}{border.bmp}
182
183 \wxheading{Parameters}
184
185 \docparam{b}{indentation from borders in pixels}
186
187
188 \membersection{wxHtmlWindow::ReadCustomization}\label{wxhtmlwindowreadcustomization}
189
190 \func{virtual void}{ReadCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
191
192 This reads custom settings from wxConfig. It uses the path 'path'
193 if given, otherwise it saves info into currently selected path.
194 The values are stored in sub-path {\tt wxHtmlWindow}
195
196 Read values : all things set by SetFonts, SetBorders.
197
198 \wxheading{Parameters}
199
200 \docparam{cfg}{wxConfig from which you wanna read configuration}
201
202 \docparam{path}{Optional path in config tree. If not given current path is used.}
203
204
205 \membersection{wxHtmlWindow::WriteCustomization}\label{wxhtmlwindowwritecustomization}
206
207 \func{virtual void}{WriteCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
208
209 Saves custom settings into wxConfig. It uses the path 'path'
210 if given, otherwise it saves info into currently selected path.
211 Regardless path is given or not the function creates sub-path
212 {\tt wxHtmlWindow}
213
214 Saved values : all things set by SetFonts, SetBorders.
215
216 \wxheading{Parameters}
217
218 \docparam{cfg}{wxConfig to which you wanna save configuration}
219
220 \docparam{path}{Optional path in config tree. If not given current path is used.}
221
222
223 \membersection{wxHtmlWindow::GetInternalRepresentation}\label{wxhtmlwindowgetinternalrepresentation}
224
225 \constfunc{wxHtmlContainerCell*}{GetInternalRepresentation}{\void}
226
227 Returns pointer to the top-level container.
228
229 See also :
230 \helpref{Cells Overview}{cells},
231 \helpref{Printing Overview}{printing}
232
233
234 \membersection{wxHtmlWindow::AddFilter}\label{wxhtmlwindowaddfilter}
235
236 \func{static void}{AddFilter}{\param{wxHtmlFilter }{*filter}}
237
238 Adds \helpref{input filter}{filters} to the static list of available
239 filters. These filters are present by default:
240
241 \begin{itemize}
242 \item {\tt text/html} MIME type
243 \item {\tt image/*} MIME types
244 \item Plain Text filter (this filter is used if no other filter matches)
245 \end{itemize}
246
247
248 \membersection{wxHtmlWindow::HistoryBack}\label{wxhtmlwindowhistoryback}
249
250 \func{bool}{HistoryBack}{\void}
251
252 Moves back to the previous page. (each page displayed using
253 \helpref{LoadPage}{wxhtmlwindowloadpage} is stored in history list.)
254
255
256 \membersection{wxHtmlWindow::HistoryForward}\label{wxhtmlwindowhistoryforward}
257
258 \func{bool}{HistoryForward}{\void}
259
260 Moves to next page in history.
261
262 \membersection{wxHtmlWindow::HistoryClear}\label{wxhtmlwindowhistoryclear}
263
264 \func{void}{HistoryClear}{\void}
265
266 Clears history.
267
268
269 \membersection{wxHtmlWindow::OnLinkClicked}\label{wxhtmlwindowonlinkclicked}
270
271 \func{virtual void}{OnLinkClicked}{\param{const wxString\& }{link}}
272
273 Called when user clicks on hypertext link. Default behaviour is to call
274 \helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else.
275
276