]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_gauge.cpp
added debugging code for redrawing
[wxWidgets.git] / src / xrc / xh_gauge.cpp
index dec1db540e1cac5bec961e332d56c608e74bec3b..4c692b9cbfd9e6a2c5db39d212ad78e4b72dc4b5 100644 (file)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        xh_gauge.cpp
-// Purpose:     XML resource for wxGauge
+// Purpose:     XRC resource for wxGauge
 // Author:      Bob Mitchell
 // Created:     2000/03/21
 // RCS-ID:      $Id$
@@ -36,14 +36,18 @@ wxGaugeXmlHandler::wxGaugeXmlHandler()
 
 wxObject *wxGaugeXmlHandler::DoCreateResource()
 { 
-    wxGauge *control = new wxGauge(m_parentAsWindow,
-                                    GetID(),
-                                    GetLong( wxT("range"), wxGAUGE_DEFAULT_RANGE), 
-                                    GetPosition(), GetSize(),
-                                    GetStyle(),
-                                    wxDefaultValidator,
-                                    GetName()
-                                    );
+    wxGauge *control = wxStaticCast(m_instance, wxGauge);
+
+    if (!control)
+       control = new wxGauge;
+
+    control->Create(m_parentAsWindow,
+                    GetID(),
+                    GetLong( wxT("range"), wxGAUGE_DEFAULT_RANGE), 
+                    GetPosition(), GetSize(),
+                    GetStyle(),
+                    wxDefaultValidator,
+                    GetName());
 
     if( HasParam( wxT("value") ))
     {