]>
Commit | Line | Data |
---|---|---|
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 | AddWindowStyles(); | |
35 | } | |
36 | ||
37 | wxObject *wxHtmlWindowXmlHandler::DoCreateResource() | |
38 | { | |
39 | wxHtmlWindow *control = new wxHtmlWindow(m_ParentAsWindow, | |
40 | GetID(), | |
41 | GetPosition(), GetSize(), | |
42 | GetStyle( _T("style" ), wxHW_SCROLLBAR_AUTO), | |
43 | GetName() | |
44 | ); | |
45 | ||
46 | if( HasParam( _T("borders") )) | |
47 | { | |
48 | control->SetBorders( GetDimension( _T("borders" ))); | |
49 | } | |
50 | ||
51 | if( HasParam( _T("url") )) | |
52 | { | |
53 | control->LoadPage( GetParamValue( _T("url" ))); | |
54 | } | |
55 | else if( HasParam( _T("htmlcode") )) | |
56 | { | |
57 | control->SetPage( GetText(_T("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, _T("wxHtmlWindow")); | |
70 | } | |
71 | ||
72 | #endif // wxUSE_HTML |