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
}
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::GetInternalRepresentation
}\label{wxhtmlwindowgetinternalrepresentation
}
58 \constfunc{wxHtmlContainerCell*
}{GetInternalRepresentation
}{\void}
60 Returns pointer to the top-level container.
62 See also:
\helpref{Cells Overview
}{cells
},
63 \helpref{Printing Overview
}{printing
}
65 \membersection{wxHtmlWindow::GetOpenedPage
}\label{wxhtmlwindowgetopenedpage
}
67 \func{wxString
}{GetOpenedPage
}{\void}
69 Returns full location of the opened page. If no page is opened or if the displayed page wasn't
70 produced by call to LoadPage, empty string is returned.
72 \membersection{wxHtmlWindow::GetRelatedFrame
}\label{wxhtmlwindowgetrelatedframe
}
74 \constfunc{wxFrame*
}{GetRelatedFrame
}{\void}
76 Returns the related frame.
78 \membersection{wxHtmlWindow::HistoryBack
}\label{wxhtmlwindowhistoryback
}
80 \func{bool
}{HistoryBack
}{\void}
82 Moves back to the previous page. (each page displayed using
83 \helpref{LoadPage
}{wxhtmlwindowloadpage
} is stored in history list.)
85 \membersection{wxHtmlWindow::HistoryClear
}\label{wxhtmlwindowhistoryclear
}
87 \func{void
}{HistoryClear
}{\void}
91 \membersection{wxHtmlWindow::HistoryForward
}\label{wxhtmlwindowhistoryforward
}
93 \func{bool
}{HistoryForward
}{\void}
95 Moves to next page in history.
97 \membersection{wxHtmlWindow::LoadPage
}\label{wxhtmlwindowloadpage
}
99 \func{bool
}{LoadPage
}{\param{const wxString\&
}{location
}}
101 Unlike SetPage this function first loads HTML page from
{\it location
}
102 and then displays it. See example:
105 htmlwin -> SetPage("help/myproject/index.htm");
108 \wxheading{Parameters
}
110 \docparam{location
}{The address of
document. See
\helpref{wxFileSystem
}{wxfilesystem
} for details on address format and behaviour of "opener".
}
112 \wxheading{Return value
}
114 FALSE if an error occured, TRUE otherwise
116 \membersection{wxHtmlWindow::OnLinkClicked
}\label{wxhtmlwindowonlinkclicked
}
118 \func{virtual void
}{OnLinkClicked
}{\param{const wxString\&
}{link
}}
120 Called when user clicks on hypertext link. Default behaviour is to call
121 \helpref{LoadPage
}{wxhtmlwindowloadpage
} and do nothing else.
123 \membersection{wxHtmlWindow::ReadCustomization
}\label{wxhtmlwindowreadcustomization
}
125 \func{virtual void
}{ReadCustomization
}{\param{wxConfigBase
}{*cfg
},
\param{wxString
}{path = wxEmptyString
}}
127 This reads custom settings from wxConfig. It uses the path 'path'
128 if given, otherwise it saves info into currently selected path.
129 The values are stored in sub-path
{\tt wxHtmlWindow
}
131 Read values: all things set by SetFonts, SetBorders.
133 \wxheading{Parameters
}
135 \docparam{cfg
}{wxConfig from which you want to read the configuration.
}
137 \docparam{path
}{Optional path in config tree. If not given current path is used.
}
139 \membersection{wxHtmlWindow::SetBorders
}\label{wxhtmlwindowsetborders
}
141 \func{void
}{SetBorders
}{\param{int
}{b
}}
143 This function sets the space between border of window and HTML contents. See image:
147 \wxheading{Parameters
}
149 \docparam{b
}{indentation from borders in pixels
}
151 \membersection{wxHtmlWindow::SetFonts
}\label{wxhtmlwindowsetfonts
}
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
}}
155 This function sets font sizes and faces.
157 \wxheading{Parameters
}
159 \docparam{normal
\_face}{This is face name for normal (i.e. non-fixed) font.
160 It can be either empty string (then the default face is choosen) or
161 platform-specific face name. Examples are "helvetica" under Unix or
162 "Times New Roman" under Windows.
}
164 \docparam{normal
\_italic\_mode}{This is either wxSLANT or wxITALIC.
166 italic (<I>..</I>) text is handled. See wxFont documentation for
167 details. For example you should use wxSLANT in conjuction with
168 "helvetica" face or wxITALIC with "times" face.
}
170 \docparam{fixed
\_face}{The same thing for fixed face ( <TT>..</TT> )
}
172 \docparam{fixed
\_italic\_mode}{The same thing for fixed face.
}
174 \docparam{sizes
}{This is an array of
7 items of
{\it int
} type.
175 The values represent size of font with HTML size from -
2 to +
4
176 ( <FONT SIZE=-
2> to <FONT SIZE=+
4> )
}
183 SetFonts("", wxSLANT, "", wxSLANT,
{10,
12,
14,
16,
19,
24,
32});
189 SetFonts("", wxSLANT, "", wxSLANT,
{7,
8,
10,
12,
16,
22,
30});
192 Athough it seems different the fact is that the fonts are of approximately
193 same size under both platforms (due to wxMSW / wxGTK inconsistency)
195 \membersection{wxHtmlWindow::SetPage
}\label{wxhtmlwindowsetpage
}
197 \func{bool
}{SetPage
}{\param{const wxString\&
}{source
}}
199 Sets HTML page and display it. This won't
{\bf load
} the page!!
200 It will display the
{\it source
}. See example:
203 htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
206 If you want to load a
document from some location use
207 \helpref{LoadPage
}{wxhtmlwindowloadpage
} instead.
209 \wxheading{Parameters
}
211 \docparam{source
}{The HTML
document source to be displayed.
}
213 \wxheading{Return value
}
215 FALSE if an error occured, TRUE otherwise.
217 \membersection{wxHtmlWindow::SetRelatedFrame
}\label{wxhtmlwindowsetrelatedframe
}
219 \func{void
}{SetRelatedFrame
}{\param{wxFrame*
}{frame
},
\param{const wxString\&
}{format
}}
221 Sets the frame in which page title will be displayed.
{\it format
} is format of
222 frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This
223 \%s is substituted with HTML page title.
225 \membersection{wxHtmlWindow::SetRelatedStatusBar
}\label{wxhtmlwindowsetrelatedstatusbar
}
227 \func{void
}{SetRelatedStatusBar
}{\param{int
}{bar
}}
229 {\bf After
} calling
\helpref{SetRelatedFrame
}{wxhtmlwindowsetrelatedframe
},
230 this sets statusbar slot where messages will be displayed.
231 (Default is -
1 = no messages.)
233 \wxheading{Parameters
}
235 \docparam{bar
}{statusbar slot number (
0..n)
}
237 \membersection{wxHtmlWindow::WriteCustomization
}\label{wxhtmlwindowwritecustomization
}
239 \func{virtual void
}{WriteCustomization
}{\param{wxConfigBase
}{*cfg
},
\param{wxString
}{path = wxEmptyString
}}
241 Saves custom settings into wxConfig. It uses the path 'path'
242 if given, otherwise it saves info into currently selected path.
243 Regardless of whether the path is given or not, the function creates sub-path
246 Saved values: all things set by SetFonts, SetBorders.
248 \wxheading{Parameters
}
250 \docparam{cfg
}{wxConfig to which you want to save the configuration.
}
252 \docparam{path
}{Optional path in config tree. If not given, the current path is used.
}