1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/gauge/gauge.cpp
3 // Purpose: wxGauge for wxUniversal
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
33 #include "wx/univ/renderer.h"
35 // ============================================================================
37 // ============================================================================
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
49 bool wxGauge
::Create(wxWindow
*parent
,
55 const wxValidator
& validator
,
58 if ( !wxGaugeBase
::Create(parent
, id
, range
, pos
, size
, style
,
69 // ----------------------------------------------------------------------------
70 // wxGauge range/position
71 // ----------------------------------------------------------------------------
73 void wxGauge
::SetRange(int range
)
75 wxGaugeBase
::SetRange(range
);
80 void wxGauge
::SetValue(int pos
)
82 wxGaugeBase
::SetValue(pos
);
87 // ----------------------------------------------------------------------------
89 // ----------------------------------------------------------------------------
91 wxSize wxGauge
::DoGetBestClientSize() const
93 wxSize size
= GetRenderer()->GetProgressBarStep();
95 // these adjustments are really ridiculous - they are just done to find the
96 // "correct" result under Windows (FIXME)
99 size
.x
= (3*size
.y
) / 2 + 2;
100 size
.y
= wxDefaultCoord
;
104 size
.y
= (3*size
.x
) / 2 + 2;
105 size
.x
= wxDefaultCoord
;
111 // ----------------------------------------------------------------------------
113 // ----------------------------------------------------------------------------
115 wxBorder wxGauge
::GetDefaultBorder() const
117 return wxBORDER_STATIC
;
120 void wxGauge
::DoDraw(wxControlRenderer
*renderer
)
122 renderer
->DrawProgressBar(this);
125 #endif // wxUSE_GAUGE