]>
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
6 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
17 #if wxUSE_XRC && wxUSE_GAUGE
19 #include "wx/xrc/xh_gauge.h"
25 static const long DEFAULT_RANGE
= 100;
27 IMPLEMENT_DYNAMIC_CLASS(wxGaugeXmlHandler
, wxXmlResourceHandler
)
29 wxGaugeXmlHandler::wxGaugeXmlHandler()
30 :wxXmlResourceHandler()
32 XRC_ADD_STYLE(wxGA_HORIZONTAL
);
33 XRC_ADD_STYLE(wxGA_VERTICAL
);
34 #if WXWIN_COMPATIBILITY_2_6
35 XRC_ADD_STYLE(wxGA_PROGRESSBAR
);
36 #endif // WXWIN_COMPATIBILITY_2_6
37 XRC_ADD_STYLE(wxGA_SMOOTH
); // windows only
41 wxObject
*wxGaugeXmlHandler::DoCreateResource()
43 XRC_MAKE_INSTANCE(control
, wxGauge
)
45 control
->Create(m_parentAsWindow
,
47 GetLong(wxT("range"), DEFAULT_RANGE
),
48 GetPosition(), GetSize(),
53 if( HasParam(wxT("value")))
55 control
->SetValue(GetLong(wxT("value")));
57 if( HasParam(wxT("shadow")))
59 control
->SetShadowWidth(GetDimension(wxT("shadow")));
61 if( HasParam(wxT("bezel")))
63 control
->SetBezelFace(GetDimension(wxT("bezel")));
71 bool wxGaugeXmlHandler::CanHandle(wxXmlNode
*node
)
73 return IsOfClass(node
, wxT("wxGauge"));
76 #endif // wxUSE_XRC && wxUSE_GAUGE