]>
Commit | Line | Data |
---|---|---|
704a4b75 VS |
1 | % |
2 | % automatically generated by HelpGen from | |
3 | % htmlwindow.tex at 14/Mar/99 20:13:37 | |
4 | % | |
5 | ||
704a4b75 VS |
6 | \section{\class{wxHtmlWindow}}\label{wxhtmlwindow} |
7 | ||
8 | wxHtmlWindow is probably the only class you will directly use | |
9 | unless you want to do something special (like adding new tag | |
448af9a4 | 10 | handlers or MIME filters). |
704a4b75 | 11 | |
448af9a4 JS |
12 | The purpose of this class is to display HTML pages (either local |
13 | file or downloaded via HTTP protocol) in a window. The width | |
14 | of the window is constant - given in the constructor - and virtual height | |
15 | is changed dynamically depending on page size. | |
fa482912 | 16 | Once the window is created you can set its content by calling |
903972f9 VS |
17 | \helpref{SetPage(text)}{wxhtmlwindowsetpage}, |
18 | \helpref{LoadPage(filename)}{wxhtmlwindowloadpage} or | |
19 | \helpref{LoadFile}{wxhtmlwindowloadfile}. | |
704a4b75 | 20 | |
5270a2f9 VS |
21 | \wxheading{Note} |
22 | ||
23 | wxHtmlWindow uses the \helpref{wxImage}{wximage} class for displaying images. | |
24 | Don't forget to initialize all image formats you need before loading any page! | |
25 | (See \helpref{wxInitAllImageHandlers}{wxinitallimagehandlers} and | |
26 | \helpref{wxImage::AddHandler}{wximageaddhandler}.) | |
27 | ||
704a4b75 VS |
28 | \wxheading{Derived from} |
29 | ||
9704b250 | 30 | \helpref{wxScrolledWindow}{wxscrolledwindow} |
704a4b75 VS |
31 | |
32 | \wxheading{Include files} | |
33 | ||
9704b250 | 34 | <wx/html/htmlwin.h> |
704a4b75 | 35 | |
a7af285d VZ |
36 | \wxheading{Library} |
37 | ||
38 | \helpref{wxHtml}{librarieslist} | |
39 | ||
a689b6d6 VS |
40 | \wxheading{Window styles} |
41 | ||
42 | \twocolwidtha{5cm} | |
43 | \begin{twocollist}\itemsep=0pt | |
44 | \twocolitem{\windowstyle{wxHW\_SCROLLBAR\_NEVER}}{Never display scrollbars, not | |
45 | even when the page is larger than the window.} | |
ec59d2cc | 46 | \twocolitem{\windowstyle{wxHW\_SCROLLBAR\_AUTO}}{Display scrollbars only if |
a689b6d6 | 47 | page's size exceeds window's size.} |
ec59d2cc | 48 | \twocolitem{\windowstyle{wxHW\_NO\_SELECTION}}{Don't allow the user to select |
a689b6d6 VS |
49 | text.} |
50 | \end{twocollist} | |
51 | ||
a1c3cdc4 VS |
52 | |
53 | \wxheading{Event handling} | |
54 | ||
55 | To process input from a wxHtmlWindow, use these event handler macros to direct input to member | |
56 | functions that take a \helpref{wxHtmlCellEvent}{wxhtmlcellevent} argument or a \helpref{wxHtmlLinkEvent}{wxhtmllinkevent}. | |
57 | ||
58 | \twocolwidtha{7cm} | |
59 | \begin{twocollist}\itemsep=0pt | |
97331b82 | 60 | \twocolitem{{\bf EVT\_HTML\_CELL\_CLICKED(id, func)}}{A \helpref{wxHtmlCell}{wxhtmlcell} was clicked.} |
7975a361 | 61 | \twocolitem{{\bf EVT\_HTML\_CELL\_HOVER(id, func)}}{The mouse passed over a \helpref{wxHtmlCell}{wxhtmlcell}.} |
97331b82 | 62 | \twocolitem{{\bf EVT\_HTML\_LINK\_CLICKED(id, func)}}{A \helpref{wxHtmlCell}{wxhtmlcell} which contains an hyperlink was clicked.} |
a1c3cdc4 VS |
63 | \end{twocollist} |
64 | ||
65 | ||
66 | \wxheading{See also} | |
67 | ||
68 | \helpref{wxHtmlLinkEvent}{wxhtmllinkevent}, \helpref{wxHtmlCellEvent}{wxhtmlcellevent} | |
69 | ||
70 | ||
71 | ||
704a4b75 VS |
72 | \membersection{wxHtmlWindow::wxHtmlWindow}\label{wxhtmlwindowwxhtmlwindow} |
73 | ||
74 | \func{}{wxHtmlWindow}{\void} | |
75 | ||
76 | Default constructor. | |
77 | ||
2284d64e | 78 | \func{}{wxHtmlWindow}{\param{wxWindow }{*parent}, \param{wxWindowID }{id = -1}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxHW\_DEFAULT\_STYLE}, \param{const wxString\& }{name = "htmlWindow"}} |
704a4b75 | 79 | |
448af9a4 | 80 | Constructor. The parameters are the same as for the \helpref{wxScrolledWindow}{wxscrolledwindow} constructor. |
704a4b75 VS |
81 | |
82 | \wxheading{Parameters} | |
83 | ||
a689b6d6 | 84 | \docparam{style}{Window style. See \helpref{wxHtmlWindow}{wxhtmlwindow}.} |
704a4b75 | 85 | |
559fe022 | 86 | \membersection{wxHtmlWindow::AddFilter}\label{wxhtmlwindowaddfilter} |
704a4b75 | 87 | |
559fe022 | 88 | \func{static void}{AddFilter}{\param{wxHtmlFilter }{*filter}} |
704a4b75 | 89 | |
559fe022 VS |
90 | Adds \helpref{input filter}{filters} to the static list of available |
91 | filters. These filters are present by default: | |
704a4b75 | 92 | |
448af9a4 | 93 | \begin{itemize}\itemsep=0pt |
559fe022 VS |
94 | \item {\tt text/html} MIME type |
95 | \item {\tt image/*} MIME types | |
96 | \item Plain Text filter (this filter is used if no other filter matches) | |
97 | \end{itemize} | |
704a4b75 | 98 | |
39029898 VS |
99 | \membersection{wxHtmlWindow::AppendToPage}\label{wxhtmlwindowappendtopage} |
100 | ||
101 | \func{bool}{AppendToPage}{\param{const wxString\& }{source}} | |
102 | ||
103 | Appends HTML fragment to currently displayed text and refreshes the window. | |
104 | ||
105 | \wxheading{Parameters} | |
106 | ||
107 | \docparam{source}{HTML code fragment} | |
108 | ||
109 | \wxheading{Return value} | |
110 | ||
cc81d32f | 111 | false if an error occurred, true otherwise. |
39029898 | 112 | |
559fe022 | 113 | \membersection{wxHtmlWindow::GetInternalRepresentation}\label{wxhtmlwindowgetinternalrepresentation} |
704a4b75 | 114 | |
559fe022 | 115 | \constfunc{wxHtmlContainerCell*}{GetInternalRepresentation}{\void} |
704a4b75 | 116 | |
559fe022 | 117 | Returns pointer to the top-level container. |
704a4b75 | 118 | |
559fe022 VS |
119 | See also: \helpref{Cells Overview}{cells}, |
120 | \helpref{Printing Overview}{printing} | |
704a4b75 | 121 | |
5656c6ef VS |
122 | \membersection{wxHtmlWindow::GetOpenedAnchor}\label{wxhtmlwindowgetopenedanchor} |
123 | ||
124 | \func{wxString}{GetOpenedAnchor}{\void} | |
125 | ||
126 | Returns anchor within currently opened page | |
127 | (see \helpref{GetOpenedPage}{wxhtmlwindowgetopenedpage}). | |
128 | If no page is opened or if the displayed page wasn't | |
129 | produced by call to LoadPage, empty string is returned. | |
130 | ||
131 | ||
559fe022 VS |
132 | \membersection{wxHtmlWindow::GetOpenedPage}\label{wxhtmlwindowgetopenedpage} |
133 | ||
134 | \func{wxString}{GetOpenedPage}{\void} | |
135 | ||
136 | Returns full location of the opened page. If no page is opened or if the displayed page wasn't | |
137 | produced by call to LoadPage, empty string is returned. | |
138 | ||
d5db80c2 VS |
139 | \membersection{wxHtmlWindow::GetOpenedPageTitle}\label{wxhtmlwindowgetopenedpagetitle} |
140 | ||
141 | \func{wxString}{GetOpenedPageTitle}{\void} | |
142 | ||
143 | Returns title of the opened page or wxEmptyString if current page does not contain {\tt <TITLE>} tag. | |
144 | ||
559fe022 VS |
145 | \membersection{wxHtmlWindow::GetRelatedFrame}\label{wxhtmlwindowgetrelatedframe} |
146 | ||
147 | \constfunc{wxFrame*}{GetRelatedFrame}{\void} | |
148 | ||
149 | Returns the related frame. | |
150 | ||
151 | \membersection{wxHtmlWindow::HistoryBack}\label{wxhtmlwindowhistoryback} | |
152 | ||
153 | \func{bool}{HistoryBack}{\void} | |
154 | ||
155 | Moves back to the previous page. (each page displayed using | |
156 | \helpref{LoadPage}{wxhtmlwindowloadpage} is stored in history list.) | |
157 | ||
1b113a81 VS |
158 | \membersection{wxHtmlWindow::HistoryCanBack}\label{wxhtmlwindowhistorycanback} |
159 | ||
160 | \func{bool}{HistoryCanBack}{\void} | |
161 | ||
162 | Returns true if it is possible to go back in the history (i.e. HistoryBack() | |
163 | won't fail). | |
164 | ||
165 | \membersection{wxHtmlWindow::HistoryCanForward}\label{wxhtmlwindowhistorycanforward} | |
166 | ||
167 | \func{bool}{HistoryCanForward}{\void} | |
168 | ||
169 | Returns true if it is possible to go forward in the history (i.e. HistoryBack() | |
170 | won't fail). | |
171 | ||
172 | ||
559fe022 VS |
173 | \membersection{wxHtmlWindow::HistoryClear}\label{wxhtmlwindowhistoryclear} |
174 | ||
175 | \func{void}{HistoryClear}{\void} | |
176 | ||
177 | Clears history. | |
178 | ||
179 | \membersection{wxHtmlWindow::HistoryForward}\label{wxhtmlwindowhistoryforward} | |
180 | ||
181 | \func{bool}{HistoryForward}{\void} | |
182 | ||
183 | Moves to next page in history. | |
704a4b75 | 184 | |
903972f9 VS |
185 | \membersection{wxHtmlWindow::LoadFile}\label{wxhtmlwindowloadfile} |
186 | ||
187 | \func{virtual bool}{LoadFile}{\param{const wxFileName\& }{filename}} | |
188 | ||
189 | Loads HTML page from file and displays it. | |
190 | ||
191 | \wxheading{Return value} | |
192 | ||
193 | false if an error occurred, true otherwise | |
194 | ||
195 | \wxheading{See also} | |
196 | ||
197 | \helpref{LoadPage}{wxhtmlwindowloadpage} | |
198 | ||
704a4b75 VS |
199 | \membersection{wxHtmlWindow::LoadPage}\label{wxhtmlwindowloadpage} |
200 | ||
298d8653 | 201 | \func{virtual bool}{LoadPage}{\param{const wxString\& }{location}} |
704a4b75 | 202 | |
448af9a4 | 203 | Unlike SetPage this function first loads HTML page from {\it location} |
704a4b75 VS |
204 | and then displays it. See example: |
205 | ||
206 | \begin{verbatim} | |
903972f9 | 207 | htmlwin->LoadPage("help/myproject/index.htm"); |
704a4b75 VS |
208 | \end{verbatim} |
209 | ||
210 | \wxheading{Parameters} | |
211 | ||
212 | \docparam{location}{The address of document. See \helpref{wxFileSystem}{wxfilesystem} for details on address format and behaviour of "opener".} | |
213 | ||
214 | \wxheading{Return value} | |
215 | ||
cc81d32f | 216 | false if an error occurred, true otherwise |
704a4b75 | 217 | |
903972f9 VS |
218 | \wxheading{See also} |
219 | ||
220 | \helpref{LoadFile}{wxhtmlwindowloadfile} | |
221 | ||
f6010d8f VZ |
222 | \membersection{wxHtmlWindow::OnCellClicked}\label{wxhtmlwindowoncellclicked} |
223 | ||
bc55e31b | 224 | \func{virtual bool}{OnCellClicked}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}, \param{const wxMouseEvent\& }{event}} |
f6010d8f VZ |
225 | |
226 | This method is called when a mouse button is clicked inside wxHtmlWindow. | |
a1c3cdc4 VS |
227 | |
228 | The default behaviour is to emit a \helpref{wxHtmlCellEvent}{wxhtmlcellevent} | |
229 | and, if the event was not processed or skipped, call | |
230 | \helpref{OnLinkClicked}{wxhtmlwindowonlinkclicked} if the cell contains an | |
f6010d8f VZ |
231 | hypertext link. |
232 | ||
a1c3cdc4 VS |
233 | Overloading this method is deprecated; intercept the event instead. |
234 | ||
235 | ||
f6010d8f VZ |
236 | \wxheading{Parameters} |
237 | ||
238 | \docparam{cell}{The cell inside which the mouse was clicked, always a simple | |
154b6b0f | 239 | (i.e. non-container) cell} |
f6010d8f VZ |
240 | |
241 | \docparam{x, y}{The logical coordinates of the click point} | |
242 | ||
243 | \docparam{event}{The mouse event containing other information about the click} | |
244 | ||
bc55e31b VS |
245 | \wxheading{Return value} |
246 | ||
247 | \true if a link was clicked, \false otherwise. | |
248 | ||
f6010d8f VZ |
249 | \membersection{wxHtmlWindow::OnCellMouseHover}\label{wxhtmlwindowoncellmousehover} |
250 | ||
251 | \func{virtual void}{OnCellMouseHover}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}} | |
252 | ||
253 | This method is called when a mouse moves over an HTML cell. | |
a1c3cdc4 VS |
254 | Default behaviour is to emit a \helpref{wxHtmlCellEvent}{wxhtmlcellevent}. |
255 | Overloading this method is deprecated; intercept the event instead. | |
f6010d8f VZ |
256 | |
257 | \wxheading{Parameters} | |
258 | ||
259 | \docparam{cell}{The cell inside which the mouse is currently, always a simple | |
154b6b0f | 260 | (i.e. non-container) cell} |
f6010d8f VZ |
261 | |
262 | \docparam{x, y}{The logical coordinates of the click point} | |
263 | ||
559fe022 | 264 | \membersection{wxHtmlWindow::OnLinkClicked}\label{wxhtmlwindowonlinkclicked} |
704a4b75 | 265 | |
d17f05af | 266 | \func{virtual void}{OnLinkClicked}{\param{const wxHtmlLinkInfo\& }{link}} |
704a4b75 | 267 | |
a1c3cdc4 VS |
268 | Called when user clicks on hypertext link. Default behaviour is to emit a |
269 | \helpref{wxHtmlLinkEvent}{wxhtmllinkevent} and, if the event was not processed | |
270 | or skipped, call \helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else. | |
271 | Overloading this method is deprecated; intercept the event instead. | |
704a4b75 | 272 | |
846914d1 VS |
273 | Also see \helpref{wxHtmlLinkInfo}{wxhtmllinkinfo}. |
274 | ||
e03ca426 VS |
275 | \membersection{wxHtmlWindow::OnOpeningURL}\label{wxhtmlwindowonopeningurl} |
276 | ||
6cc4e6b8 | 277 | \func{virtual wxHtmlOpeningStatus}{OnOpeningURL}{\param{wxHtmlURLType }{type},\param{const wxString\& }{url}, \param{wxString *}{redirect}} |
e03ca426 VS |
278 | |
279 | Called when an URL is being opened (either when the user clicks on a link or | |
6cc4e6b8 VS |
280 | an image is loaded). The URL will be opened only if OnOpeningURL returns |
281 | {\tt wxHTML\_OPEN}. This method is called by | |
282 | \helpref{wxHtmlParser::OpenURL}{wxhtmlparseropenurl}. | |
283 | You can override OnOpeningURL to selectively block some | |
284 | URLs (e.g. for security reasons) or to redirect them elsewhere. Default | |
285 | behaviour is to always return {\tt wxHTML\_OPEN}. | |
e03ca426 | 286 | |
6cc4e6b8 VS |
287 | \wxheading{Parameters} |
288 | ||
289 | \docparam{type}{Indicates type of the resource. Is one of | |
290 | \begin{twocollist}\itemsep=0pt | |
291 | \twocolitem{{\bf wxHTML\_URL\_PAGE}}{Opening a HTML page.} | |
292 | \twocolitem{{\bf wxHTML\_URL\_IMAGE}}{Opening an image.} | |
293 | \twocolitem{{\bf wxHTML\_URL\_OTHER}}{Opening a resource that doesn't fall into | |
294 | any other category.} | |
295 | \end{twocollist}} | |
296 | ||
297 | \docparam{url}{URL being opened.} | |
298 | ||
299 | \docparam{redirect}{Pointer to wxString variable that must be filled with an | |
300 | URL if OnOpeningURL returns {\tt wxHTML\_REDIRECT}.} | |
301 | ||
302 | \wxheading{Return value} | |
303 | \begin{twocollist}\itemsep=0pt | |
304 | \twocolitem{{\bf wxHTML\_OPEN}}{Open the URL.} | |
305 | \twocolitem{{\bf wxHTML\_BLOCK}}{Deny access to the URL, \helpref{wxHtmlParser::OpenURL}{wxhtmlparseropenurl} will return NULL.} | |
306 | \twocolitem{{\bf wxHTML\_REDIRECT}}{Don't open {\it url}, redirect to another | |
307 | URL. OnOpeningURL must fill {\it *redirect} with the new URL. OnOpeningURL will | |
308 | be called again on returned URL.} | |
309 | \end{twocollist} | |
d5db80c2 VS |
310 | |
311 | \membersection{wxHtmlWindow::OnSetTitle}\label{wxhtmlwindowonsettitle} | |
312 | ||
313 | \func{virtual void}{OnSetTitle}{\param{const wxString\& }{title}} | |
314 | ||
315 | Called on parsing {\tt <TITLE>} tag. | |
316 | ||
317 | ||
559fe022 | 318 | \membersection{wxHtmlWindow::ReadCustomization}\label{wxhtmlwindowreadcustomization} |
704a4b75 | 319 | |
559fe022 | 320 | \func{virtual void}{ReadCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}} |
704a4b75 | 321 | |
559fe022 VS |
322 | This reads custom settings from wxConfig. It uses the path 'path' |
323 | if given, otherwise it saves info into currently selected path. | |
324 | The values are stored in sub-path {\tt wxHtmlWindow} | |
704a4b75 | 325 | |
448af9a4 | 326 | Read values: all things set by SetFonts, SetBorders. |
704a4b75 | 327 | |
559fe022 | 328 | \wxheading{Parameters} |
704a4b75 | 329 | |
448af9a4 | 330 | \docparam{cfg}{wxConfig from which you want to read the configuration.} |
704a4b75 | 331 | |
559fe022 | 332 | \docparam{path}{Optional path in config tree. If not given current path is used.} |
704a4b75 | 333 | |
00ee93d7 VS |
334 | \membersection{wxHtmlWindow::SelectAll}\label{wxhtmlwindowselectall} |
335 | ||
336 | \func{void}{SelectAll}{\void} | |
337 | ||
338 | Selects all text in the window. | |
339 | ||
340 | \wxheading{See also} | |
341 | ||
342 | \helpref{SelectLine}{wxhtmlwindowselectline}, | |
343 | \helpref{SelectWord}{wxhtmlwindowselectword} | |
344 | ||
b55bab15 VS |
345 | \membersection{wxHtmlWindow::SelectionToText}\label{wxhtmlwindowselectiontotext} |
346 | ||
347 | \func{wxString}{SelectionToText}{\void} | |
348 | ||
349 | Returns current selection as plain text. Returns empty string if no text | |
350 | is currently selected. | |
351 | ||
00ee93d7 VS |
352 | \membersection{wxHtmlWindow::SelectLine}\label{wxhtmlwindowselectline} |
353 | ||
354 | \func{void}{SelectLine}{\param{const wxPoint\& }{pos}} | |
355 | ||
356 | Selects the line of text that \arg{pos} points at. Note that \arg{pos} | |
357 | is relative to the top of displayed page, not to window's origin, use | |
358 | \helpref{CalcUnscrolledPosition}{wxscrolledwindowcalcunscrolledposition} | |
359 | to convert physical coordinate. | |
360 | ||
361 | \wxheading{See also} | |
362 | ||
363 | \helpref{SelectAll}{wxhtmlwindowselectall}, | |
364 | \helpref{SelectWord}{wxhtmlwindowselectword} | |
365 | ||
366 | \membersection{wxHtmlWindow::SelectWord}\label{wxhtmlwindowselectword} | |
367 | ||
368 | \func{void}{SelectWord}{\param{const wxPoint\& }{pos}} | |
369 | ||
370 | Selects the word at position \arg{pos}. Note that \arg{pos} | |
371 | is relative to the top of displayed page, not to window's origin, use | |
372 | \helpref{CalcUnscrolledPosition}{wxscrolledwindowcalcunscrolledposition} | |
373 | to convert physical coordinate. | |
374 | ||
375 | \wxheading{See also} | |
376 | ||
377 | \helpref{SelectAll}{wxhtmlwindowselectall}, | |
378 | \helpref{SelectLine}{wxhtmlwindowselectline} | |
379 | ||
559fe022 | 380 | \membersection{wxHtmlWindow::SetBorders}\label{wxhtmlwindowsetborders} |
704a4b75 | 381 | |
559fe022 VS |
382 | \func{void}{SetBorders}{\param{int }{b}} |
383 | ||
384 | This function sets the space between border of window and HTML contents. See image: | |
385 | ||
605d715d | 386 | \helponly{\image{}{border.bmp}} |
704a4b75 VS |
387 | |
388 | \wxheading{Parameters} | |
389 | ||
559fe022 | 390 | \docparam{b}{indentation from borders in pixels} |
704a4b75 VS |
391 | |
392 | \membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts} | |
393 | ||
fbfb8bcc | 394 | \func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}} |
704a4b75 VS |
395 | |
396 | This function sets font sizes and faces. | |
397 | ||
398 | \wxheading{Parameters} | |
399 | ||
448af9a4 | 400 | \docparam{normal\_face}{This is face name for normal (i.e. non-fixed) font. |
2edb0bde | 401 | It can be either empty string (then the default face is chosen) or |
704a4b75 VS |
402 | platform-specific face name. Examples are "helvetica" under Unix or |
403 | "Times New Roman" under Windows.} | |
404 | ||
448af9a4 | 405 | \docparam{fixed\_face}{The same thing for fixed face ( <TT>..</TT> )} |
704a4b75 | 406 | |
704a4b75 VS |
407 | \docparam{sizes}{This is an array of 7 items of {\it int} type. |
408 | The values represent size of font with HTML size from -2 to +4 | |
4eecf115 VS |
409 | ( <FONT SIZE=-2> to <FONT SIZE=+4> ). Default sizes are used if {\it sizes} |
410 | is NULL.} | |
704a4b75 VS |
411 | |
412 | \wxheading{Defaults} | |
413 | ||
4eecf115 VS |
414 | Default font sizes are defined by constants wxHTML\_FONT\_SIZE\_1, |
415 | wxHTML\_FONT\_SIZE\_2, ..., wxHTML\_FONT\_SIZE\_7. Note that they differ among | |
416 | platforms. Default face names are empty strings. | |
704a4b75 | 417 | |
559fe022 | 418 | \membersection{wxHtmlWindow::SetPage}\label{wxhtmlwindowsetpage} |
704a4b75 | 419 | |
559fe022 | 420 | \func{bool}{SetPage}{\param{const wxString\& }{source}} |
704a4b75 | 421 | |
559fe022 VS |
422 | Sets HTML page and display it. This won't {\bf load} the page!! |
423 | It will display the {\it source}. See example: | |
704a4b75 | 424 | |
559fe022 VS |
425 | \begin{verbatim} |
426 | htmlwin -> SetPage("<html><body>Hello, world!</body></html>"); | |
427 | \end{verbatim} | |
428 | ||
448af9a4 | 429 | If you want to load a document from some location use |
559fe022 | 430 | \helpref{LoadPage}{wxhtmlwindowloadpage} instead. |
704a4b75 VS |
431 | |
432 | \wxheading{Parameters} | |
433 | ||
559fe022 | 434 | \docparam{source}{The HTML document source to be displayed.} |
704a4b75 | 435 | |
559fe022 | 436 | \wxheading{Return value} |
704a4b75 | 437 | |
cc81d32f | 438 | false if an error occurred, true otherwise. |
704a4b75 | 439 | |
559fe022 | 440 | \membersection{wxHtmlWindow::SetRelatedFrame}\label{wxhtmlwindowsetrelatedframe} |
704a4b75 | 441 | |
559fe022 | 442 | \func{void}{SetRelatedFrame}{\param{wxFrame* }{frame}, \param{const wxString\& }{format}} |
704a4b75 | 443 | |
448af9a4 | 444 | Sets the frame in which page title will be displayed. {\it format} is format of |
559fe022 VS |
445 | frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This |
446 | \%s is substituted with HTML page title. | |
704a4b75 | 447 | |
559fe022 | 448 | \membersection{wxHtmlWindow::SetRelatedStatusBar}\label{wxhtmlwindowsetrelatedstatusbar} |
704a4b75 | 449 | |
559fe022 VS |
450 | \func{void}{SetRelatedStatusBar}{\param{int }{bar}} |
451 | ||
452 | {\bf After} calling \helpref{SetRelatedFrame}{wxhtmlwindowsetrelatedframe}, | |
453 | this sets statusbar slot where messages will be displayed. | |
454 | (Default is -1 = no messages.) | |
455 | ||
456 | \wxheading{Parameters} | |
457 | ||
458 | \docparam{bar}{statusbar slot number (0..n)} | |
704a4b75 | 459 | |
b55bab15 VS |
460 | \membersection{wxHtmlWindow::ToText}\label{wxhtmlwindowtotext} |
461 | ||
462 | \func{wxString}{ToText}{\void} | |
463 | ||
464 | Returns content of currently displayed page as plain text. | |
d5db80c2 | 465 | |
704a4b75 VS |
466 | \membersection{wxHtmlWindow::WriteCustomization}\label{wxhtmlwindowwritecustomization} |
467 | ||
468 | \func{virtual void}{WriteCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}} | |
469 | ||
470 | Saves custom settings into wxConfig. It uses the path 'path' | |
471 | if given, otherwise it saves info into currently selected path. | |
448af9a4 JS |
472 | Regardless of whether the path is given or not, the function creates sub-path |
473 | {\tt wxHtmlWindow}. | |
704a4b75 | 474 | |
448af9a4 | 475 | Saved values: all things set by SetFonts, SetBorders. |
704a4b75 VS |
476 | |
477 | \wxheading{Parameters} | |
478 | ||
448af9a4 | 479 | \docparam{cfg}{wxConfig to which you want to save the configuration.} |
704a4b75 | 480 | |
448af9a4 | 481 | \docparam{path}{Optional path in config tree. If not given, the current path is used.} |
704a4b75 | 482 | |
a1c3cdc4 VS |
483 | |
484 | ||
485 | ||
486 | ||
487 | ||
488 | ||
489 | \section{\class{wxHtmlLinkEvent}}\label{wxhtmllinkevent} | |
490 | ||
491 | This event class is used for the events generated by \helpref{wxHtmlWindow}{wxhtmlwindow}. | |
492 | ||
493 | \wxheading{Derived from} | |
494 | ||
495 | \helpref{wxCommandEvent}{wxcommandevent}\\ | |
496 | \helpref{wxEvent}{wxevent}\\ | |
497 | \helpref{wxObject}{wxobject} | |
498 | ||
499 | \wxheading{Include files} | |
500 | ||
501 | <wx/html/htmlwin.h> | |
502 | ||
a7af285d VZ |
503 | \wxheading{Library} |
504 | ||
505 | \helpref{wxHtml}{librarieslist} | |
506 | ||
a1c3cdc4 VS |
507 | \wxheading{Event handling} |
508 | ||
509 | To process input from a wxHtmlLinkEvent, use one of these event handler macros to | |
510 | direct input to member function that take a \helpref{wxHtmlLinkEvent}{wxhtmllinkevent} argument: | |
511 | ||
512 | \twocolwidtha{7cm} | |
513 | \begin{twocollist} | |
97331b82 | 514 | \twocolitem{{\bf EVT\_HTML\_LINK\_CLICKED(id, func)}}{User clicked on an hyperlink.} |
a1c3cdc4 VS |
515 | \end{twocollist} |
516 | ||
517 | ||
518 | \latexignore{\rtfignore{\wxheading{Members}}} | |
519 | ||
520 | \membersection{wxHtmlLinkEvent::wxHtmlLinkEvent}\label{wxhtmllinkeventctor} | |
521 | ||
522 | \func{}{wxHyperlinkEvent}{\param{int}{ id}, \param{const wxHtmlLinkInfo \&}{ linkinfo}} | |
523 | ||
524 | The constructor is not normally used by the user code. | |
525 | ||
526 | ||
527 | \membersection{wxHtmlLinkEvent::GetLinkInfo}\label{wxhtmllinkeventgetlinkinfo} | |
528 | ||
529 | \constfunc{const wxHtmlLinkInfo &}{GetLinkInfo}{\void} | |
530 | ||
531 | Returns the \helpref{wxHtmlLinkInfo}{wxhtmllinkinfo} which contains info about the cell clicked and the hyperlink it contains. | |
532 | ||
533 | ||
534 | ||
535 | ||
536 | ||
537 | ||
538 | \section{\class{wxHtmlCellEvent}}\label{wxhtmlcellevent} | |
539 | ||
540 | This event class is used for the events generated by \helpref{wxHtmlWindow}{wxhtmlwindow}. | |
541 | ||
542 | \wxheading{Derived from} | |
543 | ||
544 | \helpref{wxCommandEvent}{wxcommandevent}\\ | |
545 | \helpref{wxEvent}{wxevent}\\ | |
546 | \helpref{wxObject}{wxobject} | |
547 | ||
548 | \wxheading{Include files} | |
549 | ||
550 | <wx/html/htmlwin.h> | |
551 | ||
a7af285d VZ |
552 | \wxheading{Library} |
553 | ||
554 | \helpref{wxHtml}{librarieslist} | |
555 | ||
a1c3cdc4 VS |
556 | \wxheading{Event handling} |
557 | ||
558 | To process input from a wxHtmlCellEvent, use one of these event handler macros to | |
559 | direct input to member function that take a \helpref{wxHtmlCellEvent}{wxhtmlcellevent} argument: | |
560 | ||
561 | \twocolwidtha{7cm} | |
562 | \begin{twocollist} | |
97331b82 RR |
563 | \twocolitem{{\bf EVT\_HTML\_CELL\_HOVER(id, func)}}{User moved the mouse over a \helpref{wxHtmlCell}{wxhtmlcell}.} |
564 | \twocolitem{{\bf EVT\_HTML\_CELL\_CLICKED(id, func)}}{User clicked on a \helpref{wxHtmlCell}{wxhtmlcell}. When handling this event, remember to use \helpref{wxHtmlCell::SetLinkClicked(true)}{wxhtmlcelleventsetlinkclicked} if the cell contains a link.} | |
a1c3cdc4 VS |
565 | \end{twocollist} |
566 | ||
567 | ||
568 | \latexignore{\rtfignore{\wxheading{Members}}} | |
569 | ||
570 | \membersection{wxHtmlCellEvent::wxHtmlCellEvent}\label{wxhtmlcelleventctor} | |
571 | ||
572 | \func{}{wxHtmlCellEvent}{\param{wxEventType}{ commandType}, \param{int}{ id}, \param{wxHtmlCell *}{ cell}, \param{const wxPoint \&}{ point}} | |
573 | ||
574 | The constructor is not normally used by the user code. | |
575 | ||
576 | ||
577 | \membersection{wxHtmlCellEvent::GetCell}\label{wxhtmlcelleventgetcell} | |
578 | ||
579 | \constfunc{wxHtmlCell *}{GetCell}{\void} | |
580 | ||
581 | Returns the \helpref{wxHtmlCellEvent}{wxhtmlcellevent} associated with the event. | |
582 | ||
583 | ||
584 | \membersection{wxHtmlCellEvent::GetPoint}\label{wxhtmlcelleventgetpoint} | |
585 | ||
586 | \constfunc{wxPoint}{GetPoint}{\void} | |
587 | ||
588 | Returns the \helpref{wxPoint}{wxpoint} associated with the event. | |
589 | ||
590 | ||
591 | \membersection{wxHtmlCellEvent::SetLinkClicked}\label{wxhtmlcelleventsetlinkclicked} | |
592 | ||
593 | \func{bool}{SetLinkClicked}{\param{bool}{ linkclicked}} | |
594 | ||
595 | Call this function with {\tt linkclicked} set to \true if the cell which has been clicked contained a link or | |
596 | \false otherwise (which is the default). With this function the event handler can return info to the | |
597 | wxHtmlWindow which sent the event. | |
598 | ||
599 | ||
600 | \membersection{wxHtmlCellEvent::GetLinkClicked}\label{wxhtmlcelleventgetlinkclicked} | |
601 | ||
602 | \constfunc{bool}{GetLinkClicked}{\void} | |
603 | ||
604 | Returns \true if \helpref{SetLinkClicked(true)}{wxhtmlcelleventsetlinkclicked} has previously been called; | |
605 | \false otherwise. | |
606 |