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{const wxString\&
}{name = "htmlWindow"
},
\param{bool
}{scrollable = TRUE
}}
38 Constructor. The parameters are same as in wxScrollWindow ctor.
39 (Too lazy to
document it once again... :-)
41 \wxheading{Parameters
}
43 \docparam{scrollable
}{if false then no scrollbars are displayed, even if size of page is larger than window size
}
47 \membersection{wxHtmlWindow::SetPage
}\label{wxhtmlwindowsetpage
}
49 \func{bool
}{SetPage
}{\param{const wxString\&
}{source
}}
51 Sets HTML page and display it. This won't
{\bf load
} the page!!
52 It will display the
{\it source
}. See example:
55 htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
58 If you want to load
document from some location use
59 \helpref{LoadPage
}{wxhtmlwindowloadpage
} instead.
61 \wxheading{Parameters
}
63 \docparam{source
}{The HTML
document source to be displayed.
}
66 \wxheading{Return value
}
68 FALSE if an error occured, TRUE otherwise
70 \membersection{wxHtmlWindow::LoadPage
}\label{wxhtmlwindowloadpage
}
72 \func{bool
}{LoadPage
}{\param{const wxString\&
}{location
}}
74 Unlike SetPage this function first loads HTML page from
{\it location
}
75 and then displays it. See example:
78 htmlwin -> SetPage("help/myproject/index.htm");
81 \wxheading{Parameters
}
83 \docparam{location
}{The address of
document. See
\helpref{wxFileSystem
}{wxfilesystem
} for details on address format and behaviour of "opener".
}
85 \wxheading{Return value
}
87 FALSE if an error occured, TRUE otherwise
91 \membersection{wxHtmlWindow::GetOpenedPage
}\label{wxhtmlwindowgetopenedpage
}
93 \func{wxString
}{GetOpenedPage
}{\void}
95 Returns full location of the opened page. If no page is opened or if the displayed page wasn't
96 produced by call to LoadPage, empty string is returned.
100 \membersection{wxHtmlWindow::SetRelatedFrame
}\label{wxhtmlwindowsetrelatedframe
}
102 \func{void
}{SetRelatedFrame
}{\param{wxFrame*
}{frame
},
\param{const wxString\&
}{format
}}
104 Sets frame in which page title will be displayed.
{\it format
} is format of
105 frame title, e.g. "HtmlHelp : \%s". It must contain exactly one \%s. This
106 \%s is substituted with HTML page title.
111 \membersection{wxHtmlWindow::GetRelatedFrame
}\label{wxhtmlwindowgetrelatedframe
}
113 \constfunc{wxFrame*
}{GetRelatedFrame
}{\void}
115 Returns the related frame.
118 \membersection{wxHtmlWindow::SetRelatedStatusBar
}\label{wxhtmlwindowsetrelatedstatusbar
}
120 \func{void
}{SetRelatedStatusBar
}{\param{int
}{bar
}}
122 {\bf After
} calling
\helpref{SetRelatedFrame
}{wxhtmlwindowsetrelatedframe
},
123 this sets statusbar slot where messages will be displayed.
124 (Default is -
1 = no messages.)
126 \wxheading{Parameters
}
128 \docparam{bar
}{statusbar slot number (
0..n)
}
130 \membersection{wxHtmlWindow::SetFonts
}\label{wxhtmlwindowsetfonts
}
132 \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 This function sets font sizes and faces.
136 \wxheading{Parameters
}
138 \docparam{normal_face
}{This is face name for normal (i.e. non-fixed) font.
139 It can be either empty string (then the default face is choosen) or
140 platform-specific face name. Examples are "helvetica" under Unix or
141 "Times New Roman" under Windows.
}
143 \docparam{normal_italic_mode
}{This is either wxSLANT or wxITALIC.
145 italic (<I>..</I>) text is handled. See wxFont documentation for
146 details. For example you should use wxSLANT in conjuction with
147 "helvetica" face or wxITALIC with "times" face.
}
149 \docparam{fixed_face
}{The same thing for fixed face ( <TT>..</TT> )
}
151 \docparam{fixed_italic_mode
}{The same thing for fixed face.
}
153 \docparam{sizes
}{This is an array of
7 items of
{\it int
} type.
154 The values represent size of font with HTML size from -
2 to +
4
155 ( <FONT SIZE=-
2> to <FONT SIZE=+
4> )
}
162 SetFonts("", wxSLANT, "", wxSLANT,
{10,
12,
14,
16,
19,
24,
32});
168 SetFonts("", wxSLANT, "", wxSLANT,
{7,
8,
10,
12,
16,
22,
30});
171 Athough it seems different the fact is that the fonts are of approximately
172 same size under both platforms (due to wxMSW / wxGTK inconsistency)
175 \membersection{wxHtmlWindow::SetBorders
}\label{wxhtmlwindowsetborders
}
177 \func{void
}{SetBorders
}{\param{int
}{b
}}
179 This function sets the space between border of window and HTML contents. See image:
183 \wxheading{Parameters
}
185 \docparam{b
}{indentation from borders in pixels
}
188 \membersection{wxHtmlWindow::ReadCustomization
}\label{wxhtmlwindowreadcustomization
}
190 \func{virtual void
}{ReadCustomization
}{\param{wxConfigBase
}{*cfg
},
\param{wxString
}{path = wxEmptyString
}}
192 This reads custom settings from wxConfig. It uses the path 'path'
193 if given, otherwise it saves info into currently selected path.
194 The values are stored in sub-path
{\tt wxHtmlWindow
}
196 Read values : all things set by SetFonts, SetBorders.
198 \wxheading{Parameters
}
200 \docparam{cfg
}{wxConfig from which you wanna read configuration
}
202 \docparam{path
}{Optional path in config tree. If not given current path is used.
}
205 \membersection{wxHtmlWindow::WriteCustomization
}\label{wxhtmlwindowwritecustomization
}
207 \func{virtual void
}{WriteCustomization
}{\param{wxConfigBase
}{*cfg
},
\param{wxString
}{path = wxEmptyString
}}
209 Saves custom settings into wxConfig. It uses the path 'path'
210 if given, otherwise it saves info into currently selected path.
211 Regardless path is given or not the function creates sub-path
214 Saved values : all things set by SetFonts, SetBorders.
216 \wxheading{Parameters
}
218 \docparam{cfg
}{wxConfig to which you wanna save configuration
}
220 \docparam{path
}{Optional path in config tree. If not given current path is used.
}
223 \membersection{wxHtmlWindow::GetInternalRepresentation
}\label{wxhtmlwindowgetinternalrepresentation
}
225 \constfunc{wxHtmlContainerCell*
}{GetInternalRepresentation
}{\void}
227 Returns pointer to the top-level container.
230 \helpref{Cells Overview
}{cells
},
231 \helpref{Printing Overview
}{printing
}
234 \membersection{wxHtmlWindow::AddFilter
}\label{wxhtmlwindowaddfilter
}
236 \func{static void
}{AddFilter
}{\param{wxHtmlFilter
}{*filter
}}
238 Adds
\helpref{input filter
}{filters
} to the static list of available
239 filters. These filters are present by default:
242 \item {\tt text/html
} MIME type
243 \item {\tt image/*
} MIME types
244 \item Plain Text filter (this filter is used if no other filter matches)
248 \membersection{wxHtmlWindow::HistoryBack
}\label{wxhtmlwindowhistoryback
}
250 \func{bool
}{HistoryBack
}{\void}
252 Moves back to the previous page. (each page displayed using
253 \helpref{LoadPage
}{wxhtmlwindowloadpage
} is stored in history list.)
256 \membersection{wxHtmlWindow::HistoryForward
}\label{wxhtmlwindowhistoryforward
}
258 \func{bool
}{HistoryForward
}{\void}
260 Moves to next page in history.
262 \membersection{wxHtmlWindow::HistoryClear
}\label{wxhtmlwindowhistoryclear
}
264 \func{void
}{HistoryClear
}{\void}
269 \membersection{wxHtmlWindow::OnLinkClicked
}\label{wxhtmlwindowonlinkclicked
}
271 \func{virtual void
}{OnLinkClicked
}{\param{const wxString\&
}{link
}}
273 Called when user clicks on hypertext link. Default behaviour is to call
274 \helpref{LoadPage
}{wxhtmlwindowloadpage
} and do nothing else.