Changes to the XRC library:
[wxWidgets.git] / src / xrc / xh_chckb.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_chckb.cpp
3 // Purpose: XRC resource for wxCheckBox
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_chckb.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/xrc/xh_chckb.h"
23 #include "wx/checkbox.h"
24
25 #if wxUSE_CHECKBOX
26
27 wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
28 : wxXmlResourceHandler()
29 {
30 AddWindowStyles();
31 }
32
33 wxObject *wxCheckBoxXmlHandler::DoCreateResource()
34 {
35 wxCheckBox *control = wxStaticCast(m_instance, wxCheckBox);
36
37 if (!control)
38 control = new wxCheckBox;
39
40 control->Create(m_parentAsWindow,
41 GetID(),
42 GetText(wxT("label")),
43 GetPosition(), GetSize(),
44 GetStyle(),
45 wxDefaultValidator,
46 GetName());
47
48 control->SetValue( GetBool( wxT("checked")));
49 SetupWindow(control);
50
51 return control;
52 }
53
54
55
56 bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node)
57 {
58 return IsOfClass(node, wxT("wxCheckBox"));
59 }
60
61 #endif