]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/htwindow.tex
added wxFileType::GetMimeTypes
[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
22wxScrolledWindow
23
24\wxheading{Include files}
25
26<wxhtml/wxhtmlwin.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::GetInternalRepresentation}\label{wxhtmlwindowgetinternalrepresentation}
57
58\constfunc{wxHtmlContainerCell*}{GetInternalRepresentation}{\void}
59
60Returns pointer to the top-level container.
61
62See also: \helpref{Cells Overview}{cells},
63\helpref{Printing Overview}{printing}
64
65\membersection{wxHtmlWindow::GetOpenedPage}\label{wxhtmlwindowgetopenedpage}
66
67\func{wxString}{GetOpenedPage}{\void}
68
69Returns full location of the opened page. If no page is opened or if the displayed page wasn't
70produced by call to LoadPage, empty string is returned.
71
72\membersection{wxHtmlWindow::GetOpenedPageTitle}\label{wxhtmlwindowgetopenedpagetitle}
73
74\func{wxString}{GetOpenedPageTitle}{\void}
75
76Returns title of the opened page or wxEmptyString if current page does not contain {\tt <TITLE>} tag.
77
78\membersection{wxHtmlWindow::GetRelatedFrame}\label{wxhtmlwindowgetrelatedframe}
79
80\constfunc{wxFrame*}{GetRelatedFrame}{\void}
81
82Returns the related frame.
83
84\membersection{wxHtmlWindow::HistoryBack}\label{wxhtmlwindowhistoryback}
85
86\func{bool}{HistoryBack}{\void}
87
88Moves back to the previous page. (each page displayed using
89\helpref{LoadPage}{wxhtmlwindowloadpage} is stored in history list.)
90
91\membersection{wxHtmlWindow::HistoryClear}\label{wxhtmlwindowhistoryclear}
92
93\func{void}{HistoryClear}{\void}
94
95Clears history.
96
97\membersection{wxHtmlWindow::HistoryForward}\label{wxhtmlwindowhistoryforward}
98
99\func{bool}{HistoryForward}{\void}
100
101Moves to next page in history.
102
103\membersection{wxHtmlWindow::LoadPage}\label{wxhtmlwindowloadpage}
104
105\func{bool}{LoadPage}{\param{const wxString\& }{location}}
106
107Unlike SetPage this function first loads HTML page from {\it location}
108and then displays it. See example:
109
110\begin{verbatim}
111htmlwin -> SetPage("help/myproject/index.htm");
112\end{verbatim}
113
114\wxheading{Parameters}
115
116\docparam{location}{The address of document. See \helpref{wxFileSystem}{wxfilesystem} for details on address format and behaviour of "opener".}
117
118\wxheading{Return value}
119
120FALSE if an error occured, TRUE otherwise
121
122\membersection{wxHtmlWindow::OnLinkClicked}\label{wxhtmlwindowonlinkclicked}
123
124\func{virtual void}{OnLinkClicked}{\param{const wxHtmlLinkInfo& }{link}}
125
126Called when user clicks on hypertext link. Default behaviour is to call
127\helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else.
128
129Also see \helpref{wxHtmlLinkInfo}{wxhtmllinkinfo}.
130
131
132\membersection{wxHtmlWindow::OnSetTitle}\label{wxhtmlwindowonsettitle}
133
134\func{virtual void}{OnSetTitle}{\param{const wxString\& }{title}}
135
136Called on parsing {\tt <TITLE>} tag.
137
138
139\membersection{wxHtmlWindow::ReadCustomization}\label{wxhtmlwindowreadcustomization}
140
141\func{virtual void}{ReadCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
142
143This reads custom settings from wxConfig. It uses the path 'path'
144if given, otherwise it saves info into currently selected path.
145The values are stored in sub-path {\tt wxHtmlWindow}
146
147Read values: all things set by SetFonts, SetBorders.
148
149\wxheading{Parameters}
150
151\docparam{cfg}{wxConfig from which you want to read the configuration.}
152
153\docparam{path}{Optional path in config tree. If not given current path is used.}
154
155\membersection{wxHtmlWindow::SetBorders}\label{wxhtmlwindowsetborders}
156
157\func{void}{SetBorders}{\param{int }{b}}
158
159This function sets the space between border of window and HTML contents. See image:
160
161\helponly{\image{}{border.bmp}}
162
163\wxheading{Parameters}
164
165\docparam{b}{indentation from borders in pixels}
166
167\membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts}
168
169\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes}}
170
171This function sets font sizes and faces.
172
173\wxheading{Parameters}
174
175\docparam{normal\_face}{This is face name for normal (i.e. non-fixed) font.
176It can be either empty string (then the default face is choosen) or
177platform-specific face name. Examples are "helvetica" under Unix or
178"Times New Roman" under Windows.}
179
180\docparam{fixed\_face}{The same thing for fixed face ( <TT>..</TT> )}
181
182\docparam{sizes}{This is an array of 7 items of {\it int} type.
183The values represent size of font with HTML size from -2 to +4
184( <FONT SIZE=-2> to <FONT SIZE=+4> )}
185
186\wxheading{Defaults}
187
188Under wxGTK:
189
190\begin{verbatim}
191 SetFonts("", "", {10, 12, 14, 16, 19, 24, 32});
192\end{verbatim}
193
194Under Windows:
195
196\begin{verbatim}
197 SetFonts("", "", {7, 8, 10, 12, 16, 22, 30});
198\end{verbatim}
199
200Athough it seems different the fact is that the fonts are of approximately
201same size under both platforms (due to wxMSW / wxGTK inconsistency)
202
203\membersection{wxHtmlWindow::SetPage}\label{wxhtmlwindowsetpage}
204
205\func{bool}{SetPage}{\param{const wxString\& }{source}}
206
207Sets HTML page and display it. This won't {\bf load} the page!!
208It will display the {\it source}. See example:
209
210\begin{verbatim}
211htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
212\end{verbatim}
213
214If you want to load a document from some location use
215\helpref{LoadPage}{wxhtmlwindowloadpage} instead.
216
217\wxheading{Parameters}
218
219\docparam{source}{The HTML document source to be displayed.}
220
221\wxheading{Return value}
222
223FALSE if an error occured, TRUE otherwise.
224
225\membersection{wxHtmlWindow::SetRelatedFrame}\label{wxhtmlwindowsetrelatedframe}
226
227\func{void}{SetRelatedFrame}{\param{wxFrame* }{frame}, \param{const wxString\& }{format}}
228
229Sets the frame in which page title will be displayed. {\it format} is format of
230frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This
231\%s is substituted with HTML page title.
232
233\membersection{wxHtmlWindow::SetRelatedStatusBar}\label{wxhtmlwindowsetrelatedstatusbar}
234
235\func{void}{SetRelatedStatusBar}{\param{int }{bar}}
236
237{\bf After} calling \helpref{SetRelatedFrame}{wxhtmlwindowsetrelatedframe},
238this sets statusbar slot where messages will be displayed.
239(Default is -1 = no messages.)
240
241\wxheading{Parameters}
242
243\docparam{bar}{statusbar slot number (0..n)}
244
245
246\membersection{wxHtmlWindow::WriteCustomization}\label{wxhtmlwindowwritecustomization}
247
248\func{virtual void}{WriteCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
249
250Saves custom settings into wxConfig. It uses the path 'path'
251if given, otherwise it saves info into currently selected path.
252Regardless of whether the path is given or not, the function creates sub-path
253{\tt wxHtmlWindow}.
254
255Saved values: all things set by SetFonts, SetBorders.
256
257\wxheading{Parameters}
258
259\docparam{cfg}{wxConfig to which you want to save the configuration.}
260
261\docparam{path}{Optional path in config tree. If not given, the current path is used.}
262