]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/htwindow.tex
added fsfile.tex
[wxWidgets.git] / docs / latex / wx / htwindow.tex
1 %
2 % automatically generated by HelpGen from
3 % htmlwindow.tex at 14/Mar/99 20:13:37
4 %
5
6
7 \section{\class{wxHtmlWindow}}\label{wxhtmlwindow}
8
9 wxHtmlWindow is probably the only class you will directly use
10 unless you want to do something special (like adding new tag
11 handlers or MIME filters)
12
13 Purpose of this class is to display HTML page (either local
14 file or downloaded via HTTP protocol) in a window. Width
15 of window is constant - given in constructor - virtual height
16 is changed dynamicly depending on page size.
17 Once the window is created you can set it's content by calling
18 \helpref{SetPage(text)}{wxhtmlwindowsetpage} or
19 \helpref{LoadPage(filename)}{wxhtmlwindowloadpage}.
20
21
22 \wxheading{Derived from}
23
24 wxScrolledWindow
25
26 \wxheading{Include files}
27
28 <wxhtml/wxhtmlwin.h>
29
30 \membersection{wxHtmlWindow::wxHtmlWindow}\label{wxhtmlwindowwxhtmlwindow}
31
32 \func{}{wxHtmlWindow}{\void}
33
34 Default constructor.
35
36 \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"}}
37
38 Constructor. The parameters are same as in wxScrollWindow ctor.
39 (Too lazy to document it once again... :-)
40
41 \wxheading{Parameters}
42
43 \docparam{style}{wxHW_SCROLLBAR_NEVER, or wxHW_SCROLLBAR_AUTO.
44 Affects appearance of vertical scrollbar in the window.}
45
46
47
48 \membersection{wxHtmlWindow::SetPage}\label{wxhtmlwindowsetpage}
49
50 \func{bool}{SetPage}{\param{const wxString\& }{source}}
51
52 Sets HTML page and display it. This won't {\bf load} the page!!
53 It will display the {\it source}. See example:
54
55 \begin{verbatim}
56 htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
57 \end{verbatim}
58
59 If you want to load document from some location use
60 \helpref{LoadPage}{wxhtmlwindowloadpage} instead.
61
62 \wxheading{Parameters}
63
64 \docparam{source}{The HTML document source to be displayed.}
65
66
67 \wxheading{Return value}
68
69 FALSE if an error occured, TRUE otherwise
70
71 \membersection{wxHtmlWindow::LoadPage}\label{wxhtmlwindowloadpage}
72
73 \func{bool}{LoadPage}{\param{const wxString\& }{location}}
74
75 Unlike SetPage this function first loads HTML page from {\it location}
76 and then displays it. See example:
77
78 \begin{verbatim}
79 htmlwin -> SetPage("help/myproject/index.htm");
80 \end{verbatim}
81
82 \wxheading{Parameters}
83
84 \docparam{location}{The address of document. See \helpref{wxFileSystem}{wxfilesystem} for details on address format and behaviour of "opener".}
85
86 \wxheading{Return value}
87
88 FALSE if an error occured, TRUE otherwise
89
90
91
92 \membersection{wxHtmlWindow::GetOpenedPage}\label{wxhtmlwindowgetopenedpage}
93
94 \func{wxString}{GetOpenedPage}{\void}
95
96 Returns full location of the opened page. If no page is opened or if the displayed page wasn't
97 produced by call to LoadPage, empty string is returned.
98
99
100
101 \membersection{wxHtmlWindow::SetRelatedFrame}\label{wxhtmlwindowsetrelatedframe}
102
103 \func{void}{SetRelatedFrame}{\param{wxFrame* }{frame}, \param{const wxString\& }{format}}
104
105 Sets frame in which page title will be displayed. {\it format} is format of
106 frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This
107 \%s is substituted with HTML page title.
108
109
110
111
112 \membersection{wxHtmlWindow::GetRelatedFrame}\label{wxhtmlwindowgetrelatedframe}
113
114 \constfunc{wxFrame*}{GetRelatedFrame}{\void}
115
116 Returns the related frame.
117
118
119 \membersection{wxHtmlWindow::SetRelatedStatusBar}\label{wxhtmlwindowsetrelatedstatusbar}
120
121 \func{void}{SetRelatedStatusBar}{\param{int }{bar}}
122
123 {\bf After} calling \helpref{SetRelatedFrame}{wxhtmlwindowsetrelatedframe},
124 this sets statusbar slot where messages will be displayed.
125 (Default is -1 = no messages.)
126
127 \wxheading{Parameters}
128
129 \docparam{bar}{statusbar slot number (0..n)}
130
131 \membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts}
132
133 \func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{int }{normal\_italic\_mode}, \param{wxString }{fixed\_face}, \param{int }{fixed\_italic\_mode}, \param{int }{*sizes}}
134
135 This function sets font sizes and faces.
136
137 \wxheading{Parameters}
138
139 \docparam{normal_face}{This is face name for normal (i.e. non-fixed) font.
140 It can be either empty string (then the default face is choosen) or
141 platform-specific face name. Examples are "helvetica" under Unix or
142 "Times New Roman" under Windows.}
143
144 \docparam{normal_italic_mode}{This is either wxSLANT or wxITALIC.
145 It determines how
146 italic (<I>..</I>) text is handled. See wxFont documentation for
147 details. For example you should use wxSLANT in conjuction with
148 "helvetica" face or wxITALIC with "times" face.}
149
150 \docparam{fixed_face}{The same thing for fixed face ( <TT>..</TT> )}
151
152 \docparam{fixed_italic_mode}{The same thing for fixed face.}
153
154 \docparam{sizes}{This is an array of 7 items of {\it int} type.
155 The values represent size of font with HTML size from -2 to +4
156 ( <FONT SIZE=-2> to <FONT SIZE=+4> )}
157
158 \wxheading{Defaults}
159
160 Under wxGTK:
161
162 \begin{verbatim}
163 SetFonts("", wxSLANT, "", wxSLANT, {10, 12, 14, 16, 19, 24, 32});
164 \end{verbatim}
165
166 Under Windows:
167
168 \begin{verbatim}
169 SetFonts("", wxSLANT, "", wxSLANT, {7, 8, 10, 12, 16, 22, 30});
170 \end{verbatim}
171
172 Athough it seems different the fact is that the fonts are of approximately
173 same size under both platforms (due to wxMSW / wxGTK inconsistency)
174
175
176 \membersection{wxHtmlWindow::SetBorders}\label{wxhtmlwindowsetborders}
177
178 \func{void}{SetBorders}{\param{int }{b}}
179
180 This function sets the space between border of window and HTML contents. See image:
181
182 \image{}{border.bmp}
183
184 \wxheading{Parameters}
185
186 \docparam{b}{indentation from borders in pixels}
187
188
189 \membersection{wxHtmlWindow::ReadCustomization}\label{wxhtmlwindowreadcustomization}
190
191 \func{virtual void}{ReadCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
192
193 This reads custom settings from wxConfig. It uses the path 'path'
194 if given, otherwise it saves info into currently selected path.
195 The values are stored in sub-path {\tt wxHtmlWindow}
196
197 Read values : all things set by SetFonts, SetBorders.
198
199 \wxheading{Parameters}
200
201 \docparam{cfg}{wxConfig from which you wanna read configuration}
202
203 \docparam{path}{Optional path in config tree. If not given current path is used.}
204
205
206 \membersection{wxHtmlWindow::WriteCustomization}\label{wxhtmlwindowwritecustomization}
207
208 \func{virtual void}{WriteCustomization}{\param{wxConfigBase }{*cfg}, \param{wxString }{path = wxEmptyString}}
209
210 Saves custom settings into wxConfig. It uses the path 'path'
211 if given, otherwise it saves info into currently selected path.
212 Regardless path is given or not the function creates sub-path
213 {\tt wxHtmlWindow}
214
215 Saved values : all things set by SetFonts, SetBorders.
216
217 \wxheading{Parameters}
218
219 \docparam{cfg}{wxConfig to which you wanna save configuration}
220
221 \docparam{path}{Optional path in config tree. If not given current path is used.}
222
223
224 \membersection{wxHtmlWindow::GetInternalRepresentation}\label{wxhtmlwindowgetinternalrepresentation}
225
226 \constfunc{wxHtmlContainerCell*}{GetInternalRepresentation}{\void}
227
228 Returns pointer to the top-level container.
229
230 See also :
231 \helpref{Cells Overview}{cells},
232 \helpref{Printing Overview}{printing}
233
234
235 \membersection{wxHtmlWindow::AddFilter}\label{wxhtmlwindowaddfilter}
236
237 \func{static void}{AddFilter}{\param{wxHtmlFilter }{*filter}}
238
239 Adds \helpref{input filter}{filters} to the static list of available
240 filters. These filters are present by default:
241
242 \begin{itemize}
243 \item {\tt text/html} MIME type
244 \item {\tt image/*} MIME types
245 \item Plain Text filter (this filter is used if no other filter matches)
246 \end{itemize}
247
248
249 \membersection{wxHtmlWindow::HistoryBack}\label{wxhtmlwindowhistoryback}
250
251 \func{bool}{HistoryBack}{\void}
252
253 Moves back to the previous page. (each page displayed using
254 \helpref{LoadPage}{wxhtmlwindowloadpage} is stored in history list.)
255
256
257 \membersection{wxHtmlWindow::HistoryForward}\label{wxhtmlwindowhistoryforward}
258
259 \func{bool}{HistoryForward}{\void}
260
261 Moves to next page in history.
262
263 \membersection{wxHtmlWindow::HistoryClear}\label{wxhtmlwindowhistoryclear}
264
265 \func{void}{HistoryClear}{\void}
266
267 Clears history.
268
269
270 \membersection{wxHtmlWindow::OnLinkClicked}\label{wxhtmlwindowonlinkclicked}
271
272 \func{virtual void}{OnLinkClicked}{\param{const wxString\& }{link}}
273
274 Called when user clicks on hypertext link. Default behaviour is to call
275 \helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else.
276
277