]> git.saurik.com Git - wxWidgets.git/blob - src/common/gaugecmn.cpp
take pixel sizes into account as well when comparing fonts, not just point sizes...
[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 #if wxUSE_GAUGE
31
32 #include "wx/gauge.h"
33
34 const wxChar wxGaugeNameStr[] = wxT("gauge");
35
36 // ============================================================================
37 // implementation
38 // ============================================================================
39
40 wxGaugeBase::~wxGaugeBase()
41 {
42 // this destructor is required for Darwin
43 }
44
45 // ----------------------------------------------------------------------------
46 // wxGauge creation
47 // ----------------------------------------------------------------------------
48
49 bool wxGaugeBase::Create(wxWindow *parent,
50 wxWindowID id,
51 int range,
52 const wxPoint& pos,
53 const wxSize& size,
54 long style,
55 const wxValidator& validator,
56 const wxString& name)
57 {
58 if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
59 return false;
60
61 SetName(name);
62
63 #if wxUSE_VALIDATORS
64 SetValidator(validator);
65 #endif // wxUSE_VALIDATORS
66
67 SetRange(range);
68 SetValue(0);
69
70 return true;
71 }
72
73 // ----------------------------------------------------------------------------
74 // wxGauge range/position
75 // ----------------------------------------------------------------------------
76
77 void wxGaugeBase::SetRange(int range)
78 {
79 m_rangeMax = range;
80 }
81
82 int wxGaugeBase::GetRange() const
83 {
84 return m_rangeMax;
85 }
86
87 void wxGaugeBase::SetValue(int pos)
88 {
89 m_gaugePos = pos;
90 }
91
92 int wxGaugeBase::GetValue() const
93 {
94 return m_gaugePos;
95 }
96
97 // ----------------------------------------------------------------------------
98 // wxGauge appearance params
99 // ----------------------------------------------------------------------------
100
101 void wxGaugeBase::SetShadowWidth(int WXUNUSED(w))
102 {
103 }
104
105 int wxGaugeBase::GetShadowWidth() const
106 {
107 return 0;
108 }
109
110
111 void wxGaugeBase::SetBezelFace(int WXUNUSED(w))
112 {
113 }
114
115 int wxGaugeBase::GetBezelFace() const
116 {
117 return 0;
118 }
119
120 #endif // wxUSE_GAUGE