]> git.saurik.com Git - wxWidgets.git/blame - src/common/gaugecmn.cpp
wxDisplay cleanup/rewrite:
[wxWidgets.git] / src / common / gaugecmn.cpp
CommitLineData
21709999
JS
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>
65571936 9// License: wxWindows licence
21709999
JS
10///////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
21709999
JS
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
799ea011
GD
38wxGaugeBase::~wxGaugeBase()
39{
40 // this destructor is required for Darwin
41}
42
21709999
JS
43// ----------------------------------------------------------------------------
44// wxGauge creation
45// ----------------------------------------------------------------------------
46
47bool 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) )
5d3e7b52 57 return false;
21709999
JS
58
59 SetName(name);
60
61#if wxUSE_VALIDATORS
62 SetValidator(validator);
63#endif // wxUSE_VALIDATORS
64
65 SetRange(range);
66 SetValue(0);
67
5d3e7b52 68 return true;
21709999
JS
69}
70
71// ----------------------------------------------------------------------------
72// wxGauge range/position
73// ----------------------------------------------------------------------------
74
75void wxGaugeBase::SetRange(int range)
76{
77 m_rangeMax = range;
78}
79
80int wxGaugeBase::GetRange() const
81{
82 return m_rangeMax;
83}
84
85void wxGaugeBase::SetValue(int pos)
86{
87 m_gaugePos = pos;
88}
89
90int wxGaugeBase::GetValue() const
91{
92 return m_gaugePos;
93}
94
95// ----------------------------------------------------------------------------
96// wxGauge appearance params
97// ----------------------------------------------------------------------------
98
99void wxGaugeBase::SetShadowWidth(int WXUNUSED(w))
100{
101}
102
103int wxGaugeBase::GetShadowWidth() const
104{
105 return 0;
106}
107
108
109void wxGaugeBase::SetBezelFace(int WXUNUSED(w))
110{
111}
112
113int wxGaugeBase::GetBezelFace() const
114{
115 return 0;
116}
117
118#endif // wxUSE_GAUGE