X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f25881804583790351480098b50f4ce1b924e697..0263da03711c430dfd7a2452dc9b0239f7081376:/src/xrc/xh_chckb.cpp diff --git a/src/xrc/xh_chckb.cpp b/src/xrc/xh_chckb.cpp index 493c876f5c..242a33645b 100644 --- a/src/xrc/xh_chckb.cpp +++ b/src/xrc/xh_chckb.cpp @@ -7,7 +7,7 @@ // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - + #ifdef __GNUG__ #pragma implementation "xh_chckb.h" #endif @@ -24,18 +24,17 @@ #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(), @@ -45,14 +44,12 @@ wxObject *wxCheckBoxXmlHandler::DoCreateResource() 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"));