X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5d6954b87d910969226ffade9714db7429211f3..1d529ef7eed851db9d007821decb9639e4e7fc16:/contrib/src/xrc/xh_chckb.cpp diff --git a/contrib/src/xrc/xh_chckb.cpp b/contrib/src/xrc/xh_chckb.cpp index 9bd2eb99ac..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,23 +34,22 @@ wxCheckBoxXmlHandler::wxCheckBoxXmlHandler() wxObject *wxCheckBoxXmlHandler::DoCreateResource() { - wxCheckBox *control = new wxCheckBox(m_parentAsWindow, - GetID(), - GetText(wxT("label")), - GetPosition(), GetSize(), - GetStyle(), - wxDefaultValidator, - GetName() - ); - - control->SetValue( GetBool( wxT("checked"))); + XRC_MAKE_INSTANCE(control, wxCheckBox) + + control->Create(m_parentAsWindow, + GetID(), + GetText(wxT("label")), + GetPosition(), GetSize(), + GetStyle(), + wxDefaultValidator, + GetName()); + + control->SetValue(GetBool( wxT("checked"))); SetupWindow(control); return control; } - - bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node) { return IsOfClass(node, wxT("wxCheckBox"));