]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_chckb.cpp
Put back wxMSW's wxStaticBitmap::DoGetBestSize because GetBitmap (used
[wxWidgets.git] / src / xrc / xh_chckb.cpp
index 9bd2eb99ace4f78a886aa9a46e2b3cc917de3a88..c7a0e824b64828e34a7f622863d74979d89f8ffb 100644 (file)
@@ -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"));