2 % automatically generated by HelpGen from
3 % htmlwindow.tex at 14/Mar/99 20:13:37
7 \section{\class{wxHtmlWindow
}}\label{wxhtmlwindow
}
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)
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
}.
22 \wxheading{Derived from
}
26 \wxheading{Include files
}
30 \membersection{wxHtmlWindow::wxHtmlWindow
}\label{wxhtmlwindowwxhtmlwindow
}
32 \func{}{wxHtmlWindow
}{\void}
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"
}}
38 Constructor. The parameters are same as in wxScrollWindow ctor.
39 (Too lazy to
document it once again... :-)
41 \wxheading{Parameters
}
43 \docparam{style
}{wxHW_SCROLLBAR_NEVER, or wxHW_SCROLLBAR_AUTO.
44 Affects appearance of vertical scrollbar in the window.
}
48 \membersection{wxHtmlWindow::SetPage
}\label{wxhtmlwindowsetpage
}
50 \func{bool
}{SetPage
}{\param{const wxString\&
}{source
}}
52 Sets HTML page and display it. This won't
{\bf load
} the page!!
53 It will display the
{\it source
}. See example:
56 htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
59 If you want to load
document from some location use
60 \helpref{LoadPage
}{wxhtmlwindowloadpage
} instead.
62 \wxheading{Parameters
}
64 \docparam{source
}{The HTML
document source to be displayed.
}
67 \wxheading{Return value
}
69 FALSE if an error occured, TRUE otherwise
71 \membersection{wxHtmlWindow::LoadPage
}\label{wxhtmlwindowloadpage
}
73 \func{bool
}{LoadPage
}{\param{const wxString\&
}{location
}}
75 Unlike SetPage this function first loads HTML page from
{\it location
}
76 and then displays it. See example:
79 htmlwin -> SetPage("help/myproject/index.htm");
82 \wxheading{Parameters
}
84 \docparam{location
}{The address of
document. See
\helpref{wxFileSystem
}{wxfilesystem
} for details on address format and behaviour of "opener".
}
86 \wxheading{Return value
}
88 FALSE if an error occured, TRUE otherwise
92 \membersection{wxHtmlWindow::GetOpenedPage
}\label{wxhtmlwindowgetopenedpage
}
94 \func{wxString
}{GetOpenedPage
}{\void}
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.
101 \membersection{wxHtmlWindow::SetRelatedFrame
}\label{wxhtmlwindowsetrelatedframe
}
103 \func{void
}{SetRelatedFrame
}{\param{wxFrame*
}{frame
},
\param{const wxString\&
}{format
}}
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.
112 \membersection{wxHtmlWindow::GetRelatedFrame
}\label{wxhtmlwindowgetrelatedframe
}
114 \constfunc{wxFrame*
}{GetRelatedFrame
}{\void}
116 Returns the related frame.
119 \membersection{wxHtmlWindow::SetRelatedStatusBar
}\label{wxhtmlwindowsetrelatedstatusbar
}
121 \func{void
}{SetRelatedStatusBar
}{\param{int
}{bar
}}
123 {\bf After
} calling
\helpref{SetRelatedFrame
}{wxhtmlwindowsetrelatedframe
},
124 this sets statusbar slot where messages will be displayed.
125 (Default is -
1 = no messages.)
127 \wxheading{Parameters
}
129 \docparam{bar
}{statusbar slot number (
0..n)
}
131 \membersection{wxHtmlWindow::SetFonts
}\label{wxhtmlwindowsetfonts
}
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
}}
135 This function sets font sizes and faces.
137 \wxheading{Parameters
}
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.
}
144 \docparam{normal_italic_mode
}{This is either wxSLANT or wxITALIC.
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.
}
150 \docparam{fixed_face
}{The same thing for fixed face ( <TT>..</TT> )
}
152 \docparam{fixed_italic_mode
}{The same thing for fixed face.
}
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> )
}
163 SetFonts("", wxSLANT, "", wxSLANT,
{10,
12,
14,
16,
19,
24,
32});
169 SetFonts("", wxSLANT, "", wxSLANT,
{7,
8,
10,
12,
16,
22,
30});
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)
176 \membersection{wxHtmlWindow::SetBorders
}\label{wxhtmlwindowsetborders
}
178 \func{void
}{SetBorders
}{\param{int
}{b
}}
180 This function sets the space between border of window and HTML contents. See image:
184 \wxheading{Parameters
}
186 \docparam{b
}{indentation from borders in pixels
}
189 \membersection{wxHtmlWindow::ReadCustomization
}\label{wxhtmlwindowreadcustomization
}
191 \func{virtual void
}{ReadCustomization
}{\param{wxConfigBase
}{*cfg
},
\param{wxString
}{path = wxEmptyString
}}
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
}
197 Read values : all things set by SetFonts, SetBorders.
199 \wxheading{Parameters
}
201 \docparam{cfg
}{wxConfig from which you wanna read configuration
}
203 \docparam{path
}{Optional path in config tree. If not given current path is used.
}
206 \membersection{wxHtmlWindow::WriteCustomization
}\label{wxhtmlwindowwritecustomization
}
208 \func{virtual void
}{WriteCustomization
}{\param{wxConfigBase
}{*cfg
},
\param{wxString
}{path = wxEmptyString
}}
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
215 Saved values : all things set by SetFonts, SetBorders.
217 \wxheading{Parameters
}
219 \docparam{cfg
}{wxConfig to which you wanna save configuration
}
221 \docparam{path
}{Optional path in config tree. If not given current path is used.
}
224 \membersection{wxHtmlWindow::GetInternalRepresentation
}\label{wxhtmlwindowgetinternalrepresentation
}
226 \constfunc{wxHtmlContainerCell*
}{GetInternalRepresentation
}{\void}
228 Returns pointer to the top-level container.
231 \helpref{Cells Overview
}{cells
},
232 \helpref{Printing Overview
}{printing
}
235 \membersection{wxHtmlWindow::AddFilter
}\label{wxhtmlwindowaddfilter
}
237 \func{static void
}{AddFilter
}{\param{wxHtmlFilter
}{*filter
}}
239 Adds
\helpref{input filter
}{filters
} to the static list of available
240 filters. These filters are present by default:
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)
249 \membersection{wxHtmlWindow::HistoryBack
}\label{wxhtmlwindowhistoryback
}
251 \func{bool
}{HistoryBack
}{\void}
253 Moves back to the previous page. (each page displayed using
254 \helpref{LoadPage
}{wxhtmlwindowloadpage
} is stored in history list.)
257 \membersection{wxHtmlWindow::HistoryForward
}\label{wxhtmlwindowhistoryforward
}
259 \func{bool
}{HistoryForward
}{\void}
261 Moves to next page in history.
263 \membersection{wxHtmlWindow::HistoryClear
}\label{wxhtmlwindowhistoryclear
}
265 \func{void
}{HistoryClear
}{\void}
270 \membersection{wxHtmlWindow::OnLinkClicked
}\label{wxhtmlwindowonlinkclicked
}
272 \func{virtual void
}{OnLinkClicked
}{\param{const wxString\&
}{link
}}
274 Called when user clicks on hypertext link. Default behaviour is to call
275 \helpref{LoadPage
}{wxhtmlwindowloadpage
} and do nothing else.