]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_gauge.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XRC resource for wxGauge
4 // Author: Bob Mitchell
7 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_gauge.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #if wxUSE_XRC && wxUSE_GAUGE
24 #include "wx/xrc/xh_gauge.h"
27 IMPLEMENT_DYNAMIC_CLASS(wxGaugeXmlHandler
, wxXmlResourceHandler
)
29 wxGaugeXmlHandler::wxGaugeXmlHandler()
30 : wxXmlResourceHandler()
32 XRC_ADD_STYLE(wxGA_HORIZONTAL
);
33 XRC_ADD_STYLE(wxGA_VERTICAL
);
34 XRC_ADD_STYLE(wxGA_PROGRESSBAR
);
35 XRC_ADD_STYLE(wxGA_SMOOTH
); // windows only
39 wxObject
*wxGaugeXmlHandler::DoCreateResource()
41 XRC_MAKE_INSTANCE(control
, wxGauge
)
43 control
->Create(m_parentAsWindow
,
45 GetLong(wxT("range"), wxGAUGE_DEFAULT_RANGE
),
46 GetPosition(), GetSize(),
51 if( HasParam(wxT("value")))
53 control
->SetValue(GetLong(wxT("value")));
55 if( HasParam(wxT("shadow")))
57 control
->SetShadowWidth(GetDimension(wxT("shadow")));
59 if( HasParam(wxT("bezel")))
61 control
->SetBezelFace(GetDimension(wxT("bezel")));
69 bool wxGaugeXmlHandler::CanHandle(wxXmlNode
*node
)
71 return IsOfClass(node
, wxT("wxGauge"));
74 #endif // wxUSE_XRC && wxUSE_GAUGE