Include wx/list.h according to precompiled headers of wx/wx.h (with other minor clean...
[wxWidgets.git] / src / common / gaugecmn.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/gaugecmn.cpp
3 // Purpose: wxGaugeBase: common to all ports methods of wxGauge
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 20.02.01
7 // RCS-ID: $Id$
8 // Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
22
23 #ifdef __BORLANDC__
24 #pragma hdrstop
25 #endif
26
27 #ifndef WX_PRECOMP
28 #endif //WX_PRECOMP
29
30 #include "wx/gauge.h"
31
32 #if wxUSE_GAUGE
33
34 // ============================================================================
35 // implementation
36 // ============================================================================
37
38 wxGaugeBase::~wxGaugeBase()
39 {
40 // this destructor is required for Darwin
41 }
42
43 // ----------------------------------------------------------------------------
44 // wxGauge creation
45 // ----------------------------------------------------------------------------
46
47 bool wxGaugeBase::Create(wxWindow *parent,
48 wxWindowID id,
49 int range,
50 const wxPoint& pos,
51 const wxSize& size,
52 long style,
53 const wxValidator& validator,
54 const wxString& name)
55 {
56 if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
57 return false;
58
59 SetName(name);
60
61 #if wxUSE_VALIDATORS
62 SetValidator(validator);
63 #endif // wxUSE_VALIDATORS
64
65 SetRange(range);
66 SetValue(0);
67
68 return true;
69 }
70
71 // ----------------------------------------------------------------------------
72 // wxGauge range/position
73 // ----------------------------------------------------------------------------
74
75 void wxGaugeBase::SetRange(int range)
76 {
77 m_rangeMax = range;
78 }
79
80 int wxGaugeBase::GetRange() const
81 {
82 return m_rangeMax;
83 }
84
85 void wxGaugeBase::SetValue(int pos)
86 {
87 m_gaugePos = pos;
88 }
89
90 int wxGaugeBase::GetValue() const
91 {
92 return m_gaugePos;
93 }
94
95 // ----------------------------------------------------------------------------
96 // wxGauge appearance params
97 // ----------------------------------------------------------------------------
98
99 void wxGaugeBase::SetShadowWidth(int WXUNUSED(w))
100 {
101 }
102
103 int wxGaugeBase::GetShadowWidth() const
104 {
105 return 0;
106 }
107
108
109 void wxGaugeBase::SetBezelFace(int WXUNUSED(w))
110 {
111 }
112
113 int wxGaugeBase::GetBezelFace() const
114 {
115 return 0;
116 }
117
118 #endif // wxUSE_GAUGE