]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_html.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XML resource for wxHtmlWindow
4 // Author: Bob Mitchell
7 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_html.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #include "wx/xml/xh_html.h"
26 #include "wx/html/htmlwin.h"
29 wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler()
30 : wxXmlResourceHandler()
32 ADD_STYLE( wxHW_SCROLLBAR_NEVER
);
33 ADD_STYLE( wxHW_SCROLLBAR_AUTO
);
36 wxObject
*wxHtmlWindowXmlHandler::DoCreateResource()
38 wxHtmlWindow
*control
= new wxHtmlWindow(m_ParentAsWindow
,
40 GetPosition(), GetSize(),
41 GetStyle( _T("style" ), wxHW_SCROLLBAR_AUTO
),
45 if( HasParam( _T("borders") ))
47 control
->SetBorders( GetDimension( _T("borders" )));
50 if( HasParam( _T("url") ))
52 control
->LoadPage( GetParamValue( _T("url" )));
54 else if( HasParam( _T("htmlcode") ))
56 control
->SetPage( GetText(_T("htmlcode")) );
66 bool wxHtmlWindowXmlHandler::CanHandle(wxXmlNode
*node
)
68 return node
->GetName() == _T("htmlwindow");