]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_chckb.cpp
added XML resources library
[wxWidgets.git] / contrib / src / xml / xh_chckb.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_chckb.cpp
3 // Purpose: XML 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/xml/xh_chckb.h"
23 #include "wx/checkbox.h"
24
25 #if wxUSE_CHECKBOX
26
27 wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
28 : wxXmlResourceHandler()
29 {
30 }
31
32 wxObject *wxCheckBoxXmlHandler::DoCreateResource()
33 {
34 wxCheckBox *control = new wxCheckBox(m_ParentAsWindow,
35 GetID(),
36 GetText(_T("label")),
37 GetPosition(), GetSize(),
38 GetStyle(),
39 wxDefaultValidator,
40 GetName()
41 );
42
43 control->SetValue( GetBool( _T("checked")));
44 SetupWindow(control);
45
46 return control;
47 }
48
49
50
51 bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node)
52 {
53 return node->GetName() == _T("checkbox");
54 }
55
56 #endif