]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_chckb.cpp
use the window default colours, not hardcoded ones, in OnSysColourChanged()
[wxWidgets.git] / src / xrc / xh_chckb.cpp
index 493c876f5c596807a256d1492634b904c7a3c216..c7a0e824b64828e34a7f622863d74979d89f8ffb 100644 (file)
@@ -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"));