X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f25881804583790351480098b50f4ce1b924e697..3ca4086b22723db16d7e0fc23aa9021b4785096a:/src/xrc/xh_chckb.cpp diff --git a/src/xrc/xh_chckb.cpp b/src/xrc/xh_chckb.cpp index 493c876f5c..c7a0e824b6 100644 --- a/src/xrc/xh_chckb.cpp +++ b/src/xrc/xh_chckb.cpp @@ -24,6 +24,8 @@ #if wxUSE_CHECKBOX +IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler, wxXmlResourceHandler) + wxCheckBoxXmlHandler::wxCheckBoxXmlHandler() : wxXmlResourceHandler() { @@ -32,10 +34,7 @@ wxCheckBoxXmlHandler::wxCheckBoxXmlHandler() 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"));