]>
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 // ============================================================================
38 // ============================================================================
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
50 bool wxGauge::Create(wxWindow
*parent
,
56 const wxValidator
& validator
,
59 if ( !wxGaugeBase::Create(parent
, id
, range
, pos
, size
, style
,
70 // ----------------------------------------------------------------------------
71 // wxGauge range/position
72 // ----------------------------------------------------------------------------
74 void wxGauge::SetRange(int range
)
76 wxGaugeBase::SetRange(range
);
81 void wxGauge::SetValue(int pos
)
83 wxGaugeBase::SetValue(pos
);
88 // ----------------------------------------------------------------------------
90 // ----------------------------------------------------------------------------
92 wxSize
wxGauge::DoGetBestClientSize() const
94 wxSize size
= GetRenderer()->GetProgressBarStep();
96 // these adjustments are really ridiculous - they are just done to find the
97 // "correct" result under Windows (FIXME)
100 size
.x
= (3*size
.y
) / 2 + 2;
101 size
.y
= wxDefaultCoord
;
105 size
.y
= (3*size
.x
) / 2 + 2;
106 size
.x
= wxDefaultCoord
;
112 // ----------------------------------------------------------------------------
114 // ----------------------------------------------------------------------------
116 wxBorder
wxGauge::GetDefaultBorder() const
118 return wxBORDER_STATIC
;
121 void wxGauge::DoDraw(wxControlRenderer
*renderer
)
123 renderer
->DrawProgressBar(this);
126 #endif // wxUSE_GAUGE