X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/78d14f80e9a72041ede52c30d912ec5cef21b1b3..34dc8f910f88dc39a2f5fd9c3d894d797212a074:/src/xrc/xh_gauge.cpp diff --git a/src/xrc/xh_gauge.cpp b/src/xrc/xh_gauge.cpp index dec1db540e..4c692b9cbf 100644 --- a/src/xrc/xh_gauge.cpp +++ b/src/xrc/xh_gauge.cpp @@ -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") )) {