]>
Commit | Line | Data |
---|---|---|
56d2f750 VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: xh_gauge.cpp | |
3 | // Purpose: XML resource for wxGauge | |
4 | // Author: Bob Mitchell | |
5 | // Created: 2000/03/21 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2000 Bob Mitchell and Verant Interactive | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifdef __GNUG__ | |
12 | #pragma implementation "xh_gauge.h" | |
13 | #endif | |
14 | ||
15 | // For compilers that support precompilation, includes "wx.h". | |
16 | #include "wx/wxprec.h" | |
17 | ||
18 | #ifdef __BORLANDC__ | |
19 | #pragma hdrstop | |
20 | #endif | |
21 | ||
22 | #include "wx/xml/xh_gauge.h" | |
23 | #include "wx/gauge.h" | |
24 | ||
25 | #if wxUSE_GAUGE | |
26 | ||
27 | wxGaugeXmlHandler::wxGaugeXmlHandler() | |
28 | : wxXmlResourceHandler() | |
29 | { | |
30 | ADD_STYLE( wxGA_HORIZONTAL ); | |
31 | ADD_STYLE( wxGA_VERTICAL ); | |
32 | ADD_STYLE( wxGA_PROGRESSBAR ); | |
33 | ADD_STYLE( wxGA_SMOOTH ); // windows only | |
34 | } | |
35 | ||
36 | wxObject *wxGaugeXmlHandler::DoCreateResource() | |
37 | { | |
38 | wxGauge *control = new wxGauge(m_ParentAsWindow, | |
39 | GetID(), | |
40 | GetLong( _T("range"), wxGAUGE_DEFAULT_RANGE), | |
41 | GetPosition(), GetSize(), | |
42 | GetStyle(), | |
43 | wxDefaultValidator, | |
44 | GetName() | |
45 | ); | |
46 | ||
47 | if( HasParam( _T("value") )) | |
48 | { | |
49 | control->SetValue( GetLong( _T("value") )); | |
50 | } | |
51 | if( HasParam( _T("shadow") )) | |
52 | { | |
bebb14d5 | 53 | control->SetShadowWidth( GetDimension( _T("shadow") )); |
56d2f750 VS |
54 | } |
55 | if( HasParam( _T("bezel") )) | |
56 | { | |
bebb14d5 | 57 | control->SetBezelFace( GetDimension( _T("bezel") )); |
56d2f750 VS |
58 | } |
59 | ||
60 | SetupWindow(control); | |
61 | ||
62 | return control; | |
63 | } | |
64 | ||
65 | ||
66 | ||
67 | bool wxGaugeXmlHandler::CanHandle(wxXmlNode *node) | |
68 | { | |
69 | return node->GetName() == _T("gauge"); | |
70 | } | |
71 | ||
72 | ||
73 | #endif // wxUSE_GAUGE |