1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XRC resource for wxCheckBox
4 // Author: Bob Mitchell
7 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
12 #pragma implementation "xh_chckb.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #if wxUSE_XRC && wxUSE_CHECKBOX
24 #include "wx/xrc/xh_chckb.h"
25 #include "wx/checkbox.h"
27 IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler
, wxXmlResourceHandler
)
29 wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
30 : wxXmlResourceHandler()
32 XRC_ADD_STYLE(wxCHK_2STATE
);
33 XRC_ADD_STYLE(wxCHK_3STATE
);
34 XRC_ADD_STYLE(wxCHK_ALLOW_3RD_STATE_FOR_USER
);
35 XRC_ADD_STYLE(wxALIGN_RIGHT
);
39 wxObject
*wxCheckBoxXmlHandler::DoCreateResource()
41 XRC_MAKE_INSTANCE(control
, wxCheckBox
)
43 control
->Create(m_parentAsWindow
,
45 GetText(wxT("label")),
46 GetPosition(), GetSize(),
51 control
->SetValue(GetBool( wxT("checked")));
57 bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode
*node
)
59 return IsOfClass(node
, wxT("wxCheckBox"));
62 #endif // wxUSE_XRC && wxUSE_CHECKBOX