]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/xrc/xh_html.cpp
changed wxXML to XRC, wx/xml/*.h->wx/xrc/*.h
[wxWidgets.git] / contrib / src / xrc / xh_html.cpp
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/xrc/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 );
34 AddWindowStyles();
35 }
36
37 wxObject *wxHtmlWindowXmlHandler::DoCreateResource()
38 {
39 wxHtmlWindow *control = new wxHtmlWindow(m_parentAsWindow,
40 GetID(),
41 GetPosition(), GetSize(),
42 GetStyle( wxT("style" ), wxHW_SCROLLBAR_AUTO),
43 GetName()
44 );
45
46 if( HasParam( wxT("borders") ))
47 {
48 control->SetBorders( GetDimension( wxT("borders" )));
49 }
50
51 if( HasParam( wxT("url") ))
52 {
53 control->LoadPage( GetParamValue( wxT("url" )));
54 }
55 else if( HasParam( wxT("htmlcode") ))
56 {
57 control->SetPage( GetText(wxT("htmlcode")) );
58 }
59
60 SetupWindow(control);
61
62 return control;
63 }
64
65
66
67 bool wxHtmlWindowXmlHandler::CanHandle(wxXmlNode *node)
68 {
69 return IsOfClass(node, wxT("wxHtmlWindow"));
70 }
71
72 #endif // wxUSE_HTML