]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_gauge.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_gauge.cpp
3 // Purpose: XRC resource for wxGauge
4 // Author: Bob Mitchell
7 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #if wxUSE_XRC && wxUSE_GAUGE
20 #include "wx/xrc/xh_gauge.h"
26 IMPLEMENT_DYNAMIC_CLASS(wxGaugeXmlHandler
, wxXmlResourceHandler
)
28 wxGaugeXmlHandler::wxGaugeXmlHandler()
29 :wxXmlResourceHandler()
31 XRC_ADD_STYLE(wxGA_HORIZONTAL
);
32 XRC_ADD_STYLE(wxGA_VERTICAL
);
33 #if WXWIN_COMPATIBILITY_2_6
34 XRC_ADD_STYLE(wxGA_PROGRESSBAR
);
35 #endif // WXWIN_COMPATIBILITY_2_6
36 XRC_ADD_STYLE(wxGA_SMOOTH
); // windows only
40 wxObject
*wxGaugeXmlHandler::DoCreateResource()
42 XRC_MAKE_INSTANCE(control
, wxGauge
)
44 control
->Create(m_parentAsWindow
,
46 GetLong(wxT("range"), wxGAUGE_DEFAULT_RANGE
),
47 GetPosition(), GetSize(),
52 if( HasParam(wxT("value")))
54 control
->SetValue(GetLong(wxT("value")));
56 if( HasParam(wxT("shadow")))
58 control
->SetShadowWidth(GetDimension(wxT("shadow")));
60 if( HasParam(wxT("bezel")))
62 control
->SetBezelFace(GetDimension(wxT("bezel")));
70 bool wxGaugeXmlHandler::CanHandle(wxXmlNode
*node
)
72 return IsOfClass(node
, wxT("wxGauge"));
75 #endif // wxUSE_XRC && wxUSE_GAUGE