]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/htwindow.tex
removed small as otherwise the code was apparently unreadable in HTML docs
[wxWidgets.git] / docs / latex / wx / htwindow.tex
... / ...
CommitLineData
1%
2% automatically generated by HelpGen from
3% htmlwindow.tex at 14/Mar/99 20:13:37
4%
5
6\section{\class{wxHtmlWindow}}\label{wxhtmlwindow}
7
8wxHtmlWindow is probably the only class you will directly use
9unless you want to do something special (like adding new tag
10handlers or MIME filters).
11
12The purpose of this class is to display HTML pages (either local
13file or downloaded via HTTP protocol) in a window. The width
14of the window is constant - given in the constructor - and virtual height
15is changed dynamically depending on page size.
16Once the window is created you can set its content by calling
17\helpref{SetPage(text)}{wxhtmlwindowsetpage} or
18\helpref{LoadPage(filename)}{wxhtmlwindowloadpage}.
19
20\wxheading{Derived from}
21
22\helpref{wxScrolledWindow}{wxscrolledwindow}
23
24\wxheading{Include files}
25
26<wx/html/htmlwin.h>
27
28\membersection{wxHtmlWindow::wxHtmlWindow}\label{wxhtmlwindowwxhtmlwindow}
29
30\func{}{wxHtmlWindow}{\void}
31
32Default constructor.
33
34\func{}{wxHtmlWindow}{\param{wxWindow }{*parent}, \param{wxWindowID }{id = -1}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxHW\_SCROLLBAR\_AUTO}, \param{const wxString\& }{name = "htmlWindow"}}
35
36Constructor. The parameters are the same as for the \helpref{wxScrolledWindow}{wxscrolledwindow} constructor.
37
38\wxheading{Parameters}
39
40\docparam{style}{wxHW\_SCROLLBAR\_NEVER, or wxHW\_SCROLLBAR\_AUTO.
41Affects the appearance of vertical scrollbar in the window.}
42
43\membersection{wxHtmlWindow::AddFilter}\label{wxhtmlwindowaddfilter}
44
45\func{static void}{AddFilter}{\param{wxHtmlFilter }{*filter}}
46
47Adds \helpref{input filter}{filters} to the static list of available
48filters. These filters are present by default:
49
50\begin{itemize}\itemsep=0pt
51\item {\tt text/html} MIME type
52\item {\tt image/*} MIME types
53\item Plain Text filter (this filter is used if no other filter matches)
54\end{itemize}
55
56\membersection{wxHtmlWindow::AppendToPage}\label{wxhtmlwindowappendtopage}
57
58\func{bool}{AppendToPage}{\param{const wxString\& }{source}}
59
60Appends HTML fragment to currently displayed text and refreshes the window.
61
62\wxheading{Parameters}
63
64\docparam{source}{HTML code fragment}
65
66\wxheading{Return value}
67
68FALSE if an error occurred, TRUE otherwise.
69
70\membersection{wxHtmlWindow::GetInternalRepresentation}\label{wxhtmlwindowgetinternalrepresentation}
71
72\constfunc{wxHtmlContainerCell*}{GetInternalRepresentation}{\void}
73
74Returns pointer to the top-level container.
75
76See also: \helpref{Cells Overview}{cells},
77\helpref{Printing Overview}{printing}
78
79\membersection{wxHtmlWindow::GetOpenedAnchor}\label{wxhtmlwindowgetopenedanchor}
80
81\func{wxString}{GetOpenedAnchor}{\void}
82
83Returns anchor within currently opened page
84(see \helpref{GetOpenedPage}{wxhtmlwindowgetopenedpage}).
85If no page is opened or if the displayed page wasn't
86produced by call to LoadPage, empty string is returned.
87
88
89\membersection{wxHtmlWindow::GetOpenedPage}\label{wxhtmlwindowgetopenedpage}
90
91\func{wxString}{GetOpenedPage}{\void}
92
93Returns full location of the opened page. If no page is opened or if the displayed page wasn't
94produced by call to LoadPage, empty string is returned.
95
96\membersection{wxHtmlWindow::GetOpenedPageTitle}\label{wxhtmlwindowgetopenedpagetitle}
97
98\func{wxString}{GetOpenedPageTitle}{\void}
99
100Returns title of the opened page or wxEmptyString if current page does not contain {\tt <TITLE>} tag.
101
102\membersection{wxHtmlWindow::GetRelatedFrame}\label{wxhtmlwindowgetrelatedframe}
103
104\constfunc{wxFrame*}{GetRelatedFrame}{\void}
105
106Returns the related frame.
107
108\membersection{wxHtmlWindow::HistoryBack}\label{wxhtmlwindowhistoryback}
109
110\func{bool}{HistoryBack}{\void}
111
112Moves back to the previous page. (each page displayed using
113\helpref{LoadPage}{wxhtmlwindowloadpage} is stored in history list.)
114
115\membersection{wxHtmlWindow::HistoryCanBack}\label{wxhtmlwindowhistorycanback}
116
117\func{bool}{HistoryCanBack}{\void}
118
119Returns true if it is possible to go back in the history (i.e. HistoryBack()
120won't fail).
121
122\membersection{wxHtmlWindow::HistoryCanForward}\label{wxhtmlwindowhistorycanforward}
123
124\func{bool}{HistoryCanForward}{\void}
125
126Returns true if it is possible to go forward in the history (i.e. HistoryBack()
127won't fail).
128
129
130\membersection{wxHtmlWindow::HistoryClear}\label{wxhtmlwindowhistoryclear}
131
132\func{void}{HistoryClear}{\void}
133
134Clears history.
135
136\membersection{wxHtmlWindow::HistoryForward}\label{wxhtmlwindowhistoryforward}
137
138\func{bool}{HistoryForward}{\void}
139
140Moves to next page in history.
141
142\membersection{wxHtmlWindow::LoadPage}\label{wxhtmlwindowloadpage}
143
144\func{virtual bool}{LoadPage}{\param{const wxString\& }{location}}
145
146Unlike SetPage this function first loads HTML page from {\it location}
147and then displays it. See example:
148
149\begin{verbatim}
150htmlwin -> SetPage("help/myproject/index.htm");
151\end{verbatim}
152
153\wxheading{Parameters}
154
155\docparam{location}{The address of document. See \helpref{wxFileSystem}{wxfilesystem} for details on address format and behaviour of "opener".}
156
157\wxheading{Return value}
158
159FALSE if an error occurred, TRUE otherwise
160
161\membersection{wxHtmlWindow::OnCellClicked}\label{wxhtmlwindowoncellclicked}
162
163\func{virtual void}{OnCellClicked}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}, \param{const wxMouseEvent\& }{event}}
164
165This method is called when a mouse button is clicked inside wxHtmlWindow.
166The default behaviour is to call
167\helpref{OnLinkClicked}{wxhtmlwindowonlinkclicked} if the cell contains a
168hypertext link.
169
170\wxheading{Parameters}
171
172\docparam{cell}{The cell inside which the mouse was clicked, always a simple
173(i.e. non container) cell}
174
175\docparam{x, y}{The logical coordinates of the click point}
176
177\docparam{event}{The mouse event containing other information about the click}
178
179\membersection{wxHtmlWindow::OnCellMouseHover}\label{wxhtmlwindowoncellmousehover}
180
181\func{virtual void}{OnCellMouseHover}{\param{wxHtmlCell }{*cell}, \param{wxCoord }{x}, \param{wxCoord }{y}}
182
183This method is called when a mouse moves over an HTML cell.
184
185\wxheading{Parameters}
186
187\docparam{cell}{The cell inside which the mouse is currently, always a simple
188(i.e. non container) cell}
189
190\docparam{x, y}{The logical coordinates of the click point}
191
192\membersection{wxHtmlWindow::OnLinkClicked}\label{wxhtmlwindowonlinkclicked}
193
194\func{virtual void}{OnLinkClicked}{\param{const wxHtmlLinkInfo\& }{link}}
195
196Called when user clicks on hypertext link. Default behaviour is to call
197\helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else.
198
199Also see \helpref{wxHtmlLinkInfo}{wxhtmllinkinfo}.
200
201
202\membersection{wxHtmlWindow::OnSetTitle}\label{wxhtmlwindowonsettitle}
203
204\func{virtual void}{OnSetTitle}{\param{const wxString\& }{title}}
205
206Called on parsing {\tt <TITLE>} tag.
207
208
209\membersection{wxHtmlWindow::ReadCustomization}\label{wxhtmlwindowreadcustomization}
210
211\func{virtual void}{ReadCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
212
213This reads custom settings from wxConfig. It uses the path 'path'
214if given, otherwise it saves info into currently selected path.
215The values are stored in sub-path {\tt wxHtmlWindow}
216
217Read values: all things set by SetFonts, SetBorders.
218
219\wxheading{Parameters}
220
221\docparam{cfg}{wxConfig from which you want to read the configuration.}
222
223\docparam{path}{Optional path in config tree. If not given current path is used.}
224
225\membersection{wxHtmlWindow::SetBorders}\label{wxhtmlwindowsetborders}
226
227\func{void}{SetBorders}{\param{int }{b}}
228
229This function sets the space between border of window and HTML contents. See image:
230
231\helponly{\image{}{border.bmp}}
232
233\wxheading{Parameters}
234
235\docparam{b}{indentation from borders in pixels}
236
237\membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts}
238
239\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes}}
240
241This function sets font sizes and faces.
242
243\wxheading{Parameters}
244
245\docparam{normal\_face}{This is face name for normal (i.e. non-fixed) font.
246It can be either empty string (then the default face is choosen) or
247platform-specific face name. Examples are "helvetica" under Unix or
248"Times New Roman" under Windows.}
249
250\docparam{fixed\_face}{The same thing for fixed face ( <TT>..</TT> )}
251
252\docparam{sizes}{This is an array of 7 items of {\it int} type.
253The values represent size of font with HTML size from -2 to +4
254( <FONT SIZE=-2> to <FONT SIZE=+4> )}
255
256\wxheading{Defaults}
257
258Under wxGTK:
259
260\begin{verbatim}
261 SetFonts("", "", {10, 12, 14, 16, 19, 24, 32});
262\end{verbatim}
263
264Under Windows:
265
266\begin{verbatim}
267 SetFonts("", "", {7, 8, 10, 12, 16, 22, 30});
268\end{verbatim}
269
270Athough it seems different the fact is that the fonts are of approximately
271same size under both platforms (due to wxMSW / wxGTK inconsistency)
272
273\membersection{wxHtmlWindow::SetPage}\label{wxhtmlwindowsetpage}
274
275\func{bool}{SetPage}{\param{const wxString\& }{source}}
276
277Sets HTML page and display it. This won't {\bf load} the page!!
278It will display the {\it source}. See example:
279
280\begin{verbatim}
281htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
282\end{verbatim}
283
284If you want to load a document from some location use
285\helpref{LoadPage}{wxhtmlwindowloadpage} instead.
286
287\wxheading{Parameters}
288
289\docparam{source}{The HTML document source to be displayed.}
290
291\wxheading{Return value}
292
293FALSE if an error occurred, TRUE otherwise.
294
295\membersection{wxHtmlWindow::SetRelatedFrame}\label{wxhtmlwindowsetrelatedframe}
296
297\func{void}{SetRelatedFrame}{\param{wxFrame* }{frame}, \param{const wxString\& }{format}}
298
299Sets the frame in which page title will be displayed. {\it format} is format of
300frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This
301\%s is substituted with HTML page title.
302
303\membersection{wxHtmlWindow::SetRelatedStatusBar}\label{wxhtmlwindowsetrelatedstatusbar}
304
305\func{void}{SetRelatedStatusBar}{\param{int }{bar}}
306
307{\bf After} calling \helpref{SetRelatedFrame}{wxhtmlwindowsetrelatedframe},
308this sets statusbar slot where messages will be displayed.
309(Default is -1 = no messages.)
310
311\wxheading{Parameters}
312
313\docparam{bar}{statusbar slot number (0..n)}
314
315
316\membersection{wxHtmlWindow::WriteCustomization}\label{wxhtmlwindowwritecustomization}
317
318\func{virtual void}{WriteCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
319
320Saves custom settings into wxConfig. It uses the path 'path'
321if given, otherwise it saves info into currently selected path.
322Regardless of whether the path is given or not, the function creates sub-path
323{\tt wxHtmlWindow}.
324
325Saved values: all things set by SetFonts, SetBorders.
326
327\wxheading{Parameters}
328
329\docparam{cfg}{wxConfig to which you want to save the configuration.}
330
331\docparam{path}{Optional path in config tree. If not given, the current path is used.}
332