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