]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/xrc/xh_chckb.cpp
removed enum that was causing more problems than it was worth
[wxWidgets.git] / contrib / src / xrc / xh_chckb.cpp
index 9974211104dab560bf0d3cba497bff4980207eed..242a33645be34a04f9b261231d2c5a11a27e3911 100644 (file)
@@ -1,13 +1,13 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        xh_chckb.cpp
-// Purpose:     XML resource for wxCheckBox
+// Purpose:     XRC resource for wxCheckBox
 // Author:      Bob Mitchell
 // Created:     2000/03/21
 // RCS-ID:      $Id$
 // Copyright:   (c) 2000 Bob Mitchell and Verant Interactive
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
+
 #ifdef __GNUG__
 #pragma implementation "xh_chckb.h"
 #endif
 
 #if wxUSE_CHECKBOX
 
-wxCheckBoxXmlHandler::wxCheckBoxXmlHandler() 
-: wxXmlResourceHandler() 
+IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler, wxXmlResourceHandler)
+
+wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
+: wxXmlResourceHandler()
 {
     AddWindowStyles();
 }
 
 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"));