// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-
+
#ifdef __GNUG__
#pragma implementation "xh_chckb.h"
#endif
#if wxUSE_CHECKBOX
-wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
-: wxXmlResourceHandler()
+IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler, wxXmlResourceHandler)
+
+wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
+: wxXmlResourceHandler()
{
AddWindowStyles();
}
wxObject *wxCheckBoxXmlHandler::DoCreateResource()
-{
- wxCheckBox *control = wxStaticCast(m_instance, wxCheckBox);
-
- if (!control)
- control = new wxCheckBox;
+{
+ XRC_MAKE_INSTANCE(control, wxCheckBox)
control->Create(m_parentAsWindow,
GetID(),
wxDefaultValidator,
GetName());
- control->SetValue( GetBool( wxT("checked")));
+ control->SetValue(GetBool( wxT("checked")));
SetupWindow(control);
-
+
return control;
}
-
-
bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node)
{
return IsOfClass(node, wxT("wxCheckBox"));