]>
git.saurik.com Git - wxWidgets.git/blob - src/univ/gauge.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/gauge/gaugecmn.cpp
3 // Purpose: wxGauge for wxUniversal
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
34 #include "wx/univ/renderer.h"
36 IMPLEMENT_DYNAMIC_CLASS(wxGauge
, wxControl
)
38 // ============================================================================
40 // ============================================================================
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
52 bool wxGauge::Create(wxWindow
*parent
,
58 const wxValidator
& validator
,
61 if ( !wxGaugeBase::Create(parent
, id
, range
, pos
, size
, style
,
72 // ----------------------------------------------------------------------------
73 // wxGauge range/position
74 // ----------------------------------------------------------------------------
76 void wxGauge::SetRange(int range
)
78 wxGaugeBase::SetRange(range
);
83 void wxGauge::SetValue(int pos
)
85 wxGaugeBase::SetValue(pos
);
90 // ----------------------------------------------------------------------------
92 // ----------------------------------------------------------------------------
94 wxSize
wxGauge::DoGetBestClientSize() const
96 wxSize size
= GetRenderer()->GetProgressBarStep();
98 // these adjustments are really ridiculous - they are just done to find the
99 // "correct" result under Windows (FIXME)
102 size
.x
= (3*size
.y
) / 2 + 2;
103 size
.y
= wxDefaultCoord
;
107 size
.y
= (3*size
.x
) / 2 + 2;
108 size
.x
= wxDefaultCoord
;
114 // ----------------------------------------------------------------------------
116 // ----------------------------------------------------------------------------
118 wxBorder
wxGauge::GetDefaultBorder() const
120 return wxBORDER_STATIC
;
123 void wxGauge::DoDraw(wxControlRenderer
*renderer
)
125 renderer
->DrawProgressBar(this);
128 #endif // wxUSE_GAUGE