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