]>
Commit | Line | Data |
---|---|---|
56d2f750 VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: xh_html.cpp | |
3 | // Purpose: XML resource for wxHtmlWindow | |
4 | // Author: Bob Mitchell | |
5 | // Created: 2000/03/21 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2000 Bob Mitchell and Verant Interactive | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifdef __GNUG__ | |
12 | #pragma implementation "xh_html.h" | |
13 | #endif | |
14 | ||
15 | // For compilers that support precompilation, includes "wx.h". | |
16 | #include "wx/wxprec.h" | |
17 | ||
18 | #ifdef __BORLANDC__ | |
19 | #pragma hdrstop | |
20 | #endif | |
21 | ||
22 | #include "wx/xml/xh_html.h" | |
23 | ||
24 | #if wxUSE_HTML | |
25 | ||
26 | #include "wx/html/htmlwin.h" | |
27 | ||
28 | ||
29 | wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler() | |
30 | : wxXmlResourceHandler() | |
31 | { | |
32 | ADD_STYLE( wxHW_SCROLLBAR_NEVER ); | |
33 | ADD_STYLE( wxHW_SCROLLBAR_AUTO ); | |
09dc1241 | 34 | AddWindowStyles(); |
56d2f750 VS |
35 | } |
36 | ||
37 | wxObject *wxHtmlWindowXmlHandler::DoCreateResource() | |
38 | { | |
ab708d5d | 39 | wxHtmlWindow *control = new wxHtmlWindow(m_parentAsWindow, |
56d2f750 VS |
40 | GetID(), |
41 | GetPosition(), GetSize(), | |
a559d708 | 42 | GetStyle( wxT("style" ), wxHW_SCROLLBAR_AUTO), |
56d2f750 VS |
43 | GetName() |
44 | ); | |
45 | ||
a559d708 | 46 | if( HasParam( wxT("borders") )) |
56d2f750 | 47 | { |
a559d708 | 48 | control->SetBorders( GetDimension( wxT("borders" ))); |
56d2f750 VS |
49 | } |
50 | ||
a559d708 | 51 | if( HasParam( wxT("url") )) |
56d2f750 | 52 | { |
a559d708 | 53 | control->LoadPage( GetParamValue( wxT("url" ))); |
56d2f750 | 54 | } |
a559d708 | 55 | else if( HasParam( wxT("htmlcode") )) |
56d2f750 | 56 | { |
a559d708 | 57 | control->SetPage( GetText(wxT("htmlcode")) ); |
56d2f750 VS |
58 | } |
59 | ||
60 | SetupWindow(control); | |
61 | ||
62 | return control; | |
63 | } | |
64 | ||
65 | ||
66 | ||
67 | bool wxHtmlWindowXmlHandler::CanHandle(wxXmlNode *node) | |
68 | { | |
a559d708 | 69 | return IsOfClass(node, wxT("wxHtmlWindow")); |
56d2f750 VS |
70 | } |
71 | ||
72 | #endif // wxUSE_HTML |