2 % automatically generated by HelpGen from
3 % htmlwindow.tex at 14/Mar/99 20:13:37
6 \section{\class{wxHtmlWindow
}}\label{wxhtmlwindow
}
8 wxHtmlWindow is probably the only class you will directly use
9 unless you want to do something special (like adding new tag
10 handlers or MIME filters).
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.
16 Once the window is created you can set its content by calling
17 \helpref{SetPage(text)
}{wxhtmlwindowsetpage
} or
18 \helpref{LoadPage(filename)
}{wxhtmlwindowloadpage
}.
20 \wxheading{Derived from
}
22 \helpref{wxScrolledWindow
}{wxscrolledwindow
}
24 \wxheading{Include files
}
28 \membersection{wxHtmlWindow::wxHtmlWindow
}\label{wxhtmlwindowwxhtmlwindow
}
30 \func{}{wxHtmlWindow
}{\void}
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"
}}
36 Constructor. The parameters are the same as for the
\helpref{wxScrolledWindow
}{wxscrolledwindow
} constructor.
38 \wxheading{Parameters
}
40 \docparam{style
}{wxHW
\_SCROLLBAR\_NEVER, or wxHW
\_SCROLLBAR\_AUTO.
41 Affects the appearance of vertical scrollbar in the window.
}
43 \membersection{wxHtmlWindow::AddFilter
}\label{wxhtmlwindowaddfilter
}
45 \func{static void
}{AddFilter
}{\param{wxHtmlFilter
}{*filter
}}
47 Adds
\helpref{input filter
}{filters
} to the static list of available
48 filters. These filters are present by default:
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)
56 \membersection{wxHtmlWindow::AppendToPage
}\label{wxhtmlwindowappendtopage
}
58 \func{bool
}{AppendToPage
}{\param{const wxString\&
}{source
}}
60 Appends HTML fragment to currently displayed text and refreshes the window.
62 \wxheading{Parameters
}
64 \docparam{source
}{HTML code fragment
}
66 \wxheading{Return value
}
68 FALSE if an error occurred, TRUE otherwise.
70 \membersection{wxHtmlWindow::GetInternalRepresentation
}\label{wxhtmlwindowgetinternalrepresentation
}
72 \constfunc{wxHtmlContainerCell*
}{GetInternalRepresentation
}{\void}
74 Returns pointer to the top-level container.
76 See also:
\helpref{Cells Overview
}{cells
},
77 \helpref{Printing Overview
}{printing
}
79 \membersection{wxHtmlWindow::GetOpenedAnchor
}\label{wxhtmlwindowgetopenedanchor
}
81 \func{wxString
}{GetOpenedAnchor
}{\void}
83 Returns anchor within currently opened page
84 (see
\helpref{GetOpenedPage
}{wxhtmlwindowgetopenedpage
}).
85 If no page is opened or if the displayed page wasn't
86 produced by call to LoadPage, empty string is returned.
89 \membersection{wxHtmlWindow::GetOpenedPage
}\label{wxhtmlwindowgetopenedpage
}
91 \func{wxString
}{GetOpenedPage
}{\void}
93 Returns full location of the opened page. If no page is opened or if the displayed page wasn't
94 produced by call to LoadPage, empty string is returned.
96 \membersection{wxHtmlWindow::GetOpenedPageTitle
}\label{wxhtmlwindowgetopenedpagetitle
}
98 \func{wxString
}{GetOpenedPageTitle
}{\void}
100 Returns title of the opened page or wxEmptyString if current page does not contain
{\tt <TITLE>
} tag.
102 \membersection{wxHtmlWindow::GetRelatedFrame
}\label{wxhtmlwindowgetrelatedframe
}
104 \constfunc{wxFrame*
}{GetRelatedFrame
}{\void}
106 Returns the related frame.
108 \membersection{wxHtmlWindow::HistoryBack
}\label{wxhtmlwindowhistoryback
}
110 \func{bool
}{HistoryBack
}{\void}
112 Moves back to the previous page. (each page displayed using
113 \helpref{LoadPage
}{wxhtmlwindowloadpage
} is stored in history list.)
115 \membersection{wxHtmlWindow::HistoryCanBack
}\label{wxhtmlwindowhistorycanback
}
117 \func{bool
}{HistoryCanBack
}{\void}
119 Returns true if it is possible to go back in the history (i.e. HistoryBack()
122 \membersection{wxHtmlWindow::HistoryCanForward
}\label{wxhtmlwindowhistorycanforward
}
124 \func{bool
}{HistoryCanForward
}{\void}
126 Returns true if it is possible to go forward in the history (i.e. HistoryBack()
130 \membersection{wxHtmlWindow::HistoryClear
}\label{wxhtmlwindowhistoryclear
}
132 \func{void
}{HistoryClear
}{\void}
136 \membersection{wxHtmlWindow::HistoryForward
}\label{wxhtmlwindowhistoryforward
}
138 \func{bool
}{HistoryForward
}{\void}
140 Moves to next page in history.
142 \membersection{wxHtmlWindow::LoadPage
}\label{wxhtmlwindowloadpage
}
144 \func{virtual bool
}{LoadPage
}{\param{const wxString\&
}{location
}}
146 Unlike SetPage this function first loads HTML page from
{\it location
}
147 and then displays it. See example:
150 htmlwin -> SetPage("help/myproject/index.htm");
153 \wxheading{Parameters
}
155 \docparam{location
}{The address of
document. See
\helpref{wxFileSystem
}{wxfilesystem
} for details on address format and behaviour of "opener".
}
157 \wxheading{Return value
}
159 FALSE if an error occurred, TRUE otherwise
161 \membersection{wxHtmlWindow::OnCellClicked
}\label{wxhtmlwindowoncellclicked
}
163 \func{virtual void
}{OnCellClicked
}{\param{wxHtmlCell
}{*cell
},
\param{wxCoord
}{x
},
\param{wxCoord
}{y
},
\param{const wxMouseEvent\&
}{event
}}
165 This method is called when a mouse button is clicked inside wxHtmlWindow.
166 The default behaviour is to call
167 \helpref{OnLinkClicked
}{wxhtmlwindowonlinkclicked
} if the cell contains a
170 \wxheading{Parameters
}
172 \docparam{cell
}{The cell inside which the mouse was clicked, always a simple
173 (i.e. non container) cell
}
175 \docparam{x, y
}{The logical coordinates of the click point
}
177 \docparam{event
}{The mouse event containing other information about the click
}
179 \membersection{wxHtmlWindow::OnCellMouseHover
}\label{wxhtmlwindowoncellmousehover
}
181 \func{virtual void
}{OnCellMouseHover
}{\param{wxHtmlCell
}{*cell
},
\param{wxCoord
}{x
},
\param{wxCoord
}{y
}}
183 This method is called when a mouse moves over an HTML cell.
185 \wxheading{Parameters
}
187 \docparam{cell
}{The cell inside which the mouse is currently, always a simple
188 (i.e. non container) cell
}
190 \docparam{x, y
}{The logical coordinates of the click point
}
192 \membersection{wxHtmlWindow::OnLinkClicked
}\label{wxhtmlwindowonlinkclicked
}
194 \func{virtual void
}{OnLinkClicked
}{\param{const wxHtmlLinkInfo\&
}{link
}}
196 Called when user clicks on hypertext link. Default behaviour is to call
197 \helpref{LoadPage
}{wxhtmlwindowloadpage
} and do nothing else.
199 Also see
\helpref{wxHtmlLinkInfo
}{wxhtmllinkinfo
}.
201 \membersection{wxHtmlWindow::OnOpeningURL
}\label{wxhtmlwindowonopeningurl
}
203 \func{virtual bool
}{OnOpeningURL
}{\param{const wxString\&
}{url
}}
205 Called when an URL is being opened (either when the user clicks on a link or
206 an image is loaded). If the function returns FALSE, the URL won't be fetched.
207 Default behaviour is to return TRUE.
209 Also see
\helpref{wxHtmlWinParser::CanOpenURL
}{wxhtmlwinparsercanopenurl
}.
211 \membersection{wxHtmlWindow::OnSetTitle
}\label{wxhtmlwindowonsettitle
}
213 \func{virtual void
}{OnSetTitle
}{\param{const wxString\&
}{title
}}
215 Called on parsing
{\tt <TITLE>
} tag.
218 \membersection{wxHtmlWindow::ReadCustomization
}\label{wxhtmlwindowreadcustomization
}
220 \func{virtual void
}{ReadCustomization
}{\param{wxConfigBase
}{*cfg
},
\param{wxString
}{path = wxEmptyString
}}
222 This reads custom settings from wxConfig. It uses the path 'path'
223 if given, otherwise it saves info into currently selected path.
224 The values are stored in sub-path
{\tt wxHtmlWindow
}
226 Read values: all things set by SetFonts, SetBorders.
228 \wxheading{Parameters
}
230 \docparam{cfg
}{wxConfig from which you want to read the configuration.
}
232 \docparam{path
}{Optional path in config tree. If not given current path is used.
}
234 \membersection{wxHtmlWindow::SetBorders
}\label{wxhtmlwindowsetborders
}
236 \func{void
}{SetBorders
}{\param{int
}{b
}}
238 This function sets the space between border of window and HTML contents. See image:
240 \helponly{\image{}{border.bmp
}}
242 \wxheading{Parameters
}
244 \docparam{b
}{indentation from borders in pixels
}
246 \membersection{wxHtmlWindow::SetFonts
}\label{wxhtmlwindowsetfonts
}
248 \func{void
}{SetFonts
}{\param{wxString
}{normal
\_face},
\param{wxString
}{fixed
\_face},
\param{const int
}{*sizes
}}
250 This function sets font sizes and faces.
252 \wxheading{Parameters
}
254 \docparam{normal
\_face}{This is face name for normal (i.e. non-fixed) font.
255 It can be either empty string (then the default face is choosen) or
256 platform-specific face name. Examples are "helvetica" under Unix or
257 "Times New Roman" under Windows.
}
259 \docparam{fixed
\_face}{The same thing for fixed face ( <TT>..</TT> )
}
261 \docparam{sizes
}{This is an array of
7 items of
{\it int
} type.
262 The values represent size of font with HTML size from -
2 to +
4
263 ( <FONT SIZE=-
2> to <FONT SIZE=+
4> )
}
270 SetFonts("", "",
{10,
12,
14,
16,
19,
24,
32});
276 SetFonts("", "",
{7,
8,
10,
12,
16,
22,
30});
279 Athough it seems different the fact is that the fonts are of approximately
280 same size under both platforms (due to wxMSW / wxGTK inconsistency)
282 \membersection{wxHtmlWindow::SetPage
}\label{wxhtmlwindowsetpage
}
284 \func{bool
}{SetPage
}{\param{const wxString\&
}{source
}}
286 Sets HTML page and display it. This won't
{\bf load
} the page!!
287 It will display the
{\it source
}. See example:
290 htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
293 If you want to load a
document from some location use
294 \helpref{LoadPage
}{wxhtmlwindowloadpage
} instead.
296 \wxheading{Parameters
}
298 \docparam{source
}{The HTML
document source to be displayed.
}
300 \wxheading{Return value
}
302 FALSE if an error occurred, TRUE otherwise.
304 \membersection{wxHtmlWindow::SetRelatedFrame
}\label{wxhtmlwindowsetrelatedframe
}
306 \func{void
}{SetRelatedFrame
}{\param{wxFrame*
}{frame
},
\param{const wxString\&
}{format
}}
308 Sets the frame in which page title will be displayed.
{\it format
} is format of
309 frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This
310 \%s is substituted with HTML page title.
312 \membersection{wxHtmlWindow::SetRelatedStatusBar
}\label{wxhtmlwindowsetrelatedstatusbar
}
314 \func{void
}{SetRelatedStatusBar
}{\param{int
}{bar
}}
316 {\bf After
} calling
\helpref{SetRelatedFrame
}{wxhtmlwindowsetrelatedframe
},
317 this sets statusbar slot where messages will be displayed.
318 (Default is -
1 = no messages.)
320 \wxheading{Parameters
}
322 \docparam{bar
}{statusbar slot number (
0..n)
}
325 \membersection{wxHtmlWindow::WriteCustomization
}\label{wxhtmlwindowwritecustomization
}
327 \func{virtual void
}{WriteCustomization
}{\param{wxConfigBase
}{*cfg
},
\param{wxString
}{path = wxEmptyString
}}
329 Saves custom settings into wxConfig. It uses the path 'path'
330 if given, otherwise it saves info into currently selected path.
331 Regardless of whether the path is given or not, the function creates sub-path
334 Saved values: all things set by SetFonts, SetBorders.
336 \wxheading{Parameters
}
338 \docparam{cfg
}{wxConfig to which you want to save the configuration.
}
340 \docparam{path
}{Optional path in config tree. If not given, the current path is used.
}