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