]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_chckb.cpp
added wxTextCtrl::HitTest(); implemented it for MSW
[wxWidgets.git] / src / xrc / xh_chckb.cpp
index 9974211104dab560bf0d3cba497bff4980207eed..c7a0e824b64828e34a7f622863d74979d89f8ffb 100644 (file)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        xh_chckb.cpp
-// Purpose:     XML resource for wxCheckBox
+// Purpose:     XRC resource for wxCheckBox
 // Author:      Bob Mitchell
 // Created:     2000/03/21
 // RCS-ID:      $Id$
@@ -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"));