/////////////////////////////////////////////////////////////////////////////
// Name: xh_gauge.cpp
-// Purpose: XML resource for wxGauge
+// Purpose: XRC resource for wxGauge
// Author: Bob Mitchell
// Created: 2000/03/21
// RCS-ID: $Id$
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") ))
{