]> git.saurik.com Git - wxWidgets.git/blame - contrib/src/xml/xh_html.cpp
compilation fixes for mingw32 (still leaving disabled for now)
[wxWidgets.git] / contrib / src / xml / xh_html.cpp
CommitLineData
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
29wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler()
30: wxXmlResourceHandler()
31{
32 ADD_STYLE( wxHW_SCROLLBAR_NEVER );
33 ADD_STYLE( wxHW_SCROLLBAR_AUTO );
34}
35
36wxObject *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 {
bebb14d5 47 control->SetBorders( GetDimension( _T("borders" )));
56d2f750
VS
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
66bool wxHtmlWindowXmlHandler::CanHandle(wxXmlNode *node)
67{
68 return node->GetName() == _T("htmlwindow");
69}
70
71#endif // wxUSE_HTML