X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f25881804583790351480098b50f4ce1b924e697..1d529ef7eed851db9d007821decb9639e4e7fc16:/contrib/src/xrc/xh_chckb.cpp?ds=sidebyside diff --git a/contrib/src/xrc/xh_chckb.cpp b/contrib/src/xrc/xh_chckb.cpp index 493c876f5c..c7a0e824b6 100644 --- a/contrib/src/xrc/xh_chckb.cpp +++ b/contrib/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"));