1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_chckb.cpp
3 // Purpose: XRC resource for wxCheckBox
4 // Author: Bob Mitchell
6 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
17 #if wxUSE_XRC && wxUSE_CHECKBOX
19 #include "wx/xrc/xh_chckb.h"
22 #include "wx/checkbox.h"
25 IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler
, wxXmlResourceHandler
)
27 wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
28 : wxXmlResourceHandler()
30 XRC_ADD_STYLE(wxCHK_2STATE
);
31 XRC_ADD_STYLE(wxCHK_3STATE
);
32 XRC_ADD_STYLE(wxCHK_ALLOW_3RD_STATE_FOR_USER
);
33 XRC_ADD_STYLE(wxALIGN_RIGHT
);
37 wxObject
*wxCheckBoxXmlHandler::DoCreateResource()
39 XRC_MAKE_INSTANCE(control
, wxCheckBox
)
41 control
->Create(m_parentAsWindow
,
43 GetText(wxT("label")),
44 GetPosition(), GetSize(),
49 control
->SetValue(GetBool( wxT("checked")));
55 bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode
*node
)
57 return IsOfClass(node
, wxT("wxCheckBox"));
60 #endif // wxUSE_XRC && wxUSE_CHECKBOX