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