]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_html.cpp
23a5cb4c27ea6cc63667d3099e7758ae111bcdce
   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 
); 
  37 wxObject 
*wxHtmlWindowXmlHandler::DoCreateResource() 
  39     wxHtmlWindow 
*control 
= new wxHtmlWindow(m_ParentAsWindow
, 
  41                                     GetPosition(), GetSize(), 
  42                                     GetStyle( _T("style" ), wxHW_SCROLLBAR_AUTO
), 
  46     if( HasParam( _T("borders") )) 
  48         control
->SetBorders( GetDimension( _T("borders" ))); 
  51     if( HasParam( _T("url") )) 
  53         control
->LoadPage( GetParamValue( _T("url" ))); 
  55     else if( HasParam( _T("htmlcode") )) 
  57         control
->SetPage( GetText(_T("htmlcode")) ); 
  67 bool wxHtmlWindowXmlHandler::CanHandle(wxXmlNode 
*node
) 
  69     return IsOfClass(node
, _T("wxHtmlWindow"));