]>
git.saurik.com Git - wxWidgets.git/blob - src/univ/gauge.cpp
c8ebbb2289d05a94aa64ecde5cef47649d0b2833
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 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "gaugeuniv.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
38 #include "wx/univ/renderer.h"
40 IMPLEMENT_DYNAMIC_CLASS(wxGauge
, wxControl
)
42 // ============================================================================
44 // ============================================================================
46 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
56 bool wxGauge::Create(wxWindow
*parent
,
62 const wxValidator
& validator
,
65 if ( !wxGaugeBase::Create(parent
, id
, range
, pos
, size
, style
,
76 // ----------------------------------------------------------------------------
77 // wxGauge range/position
78 // ----------------------------------------------------------------------------
80 void wxGauge::SetRange(int range
)
82 wxGaugeBase::SetRange(range
);
87 void wxGauge::SetValue(int pos
)
89 wxGaugeBase::SetValue(pos
);
94 // ----------------------------------------------------------------------------
96 // ----------------------------------------------------------------------------
98 wxSize
wxGauge::DoGetBestClientSize() const
100 wxSize size
= GetRenderer()->GetProgressBarStep();
102 // these adjustments are really ridiculous - they are just done to find the
103 // "correct" result under Windows (FIXME)
106 size
.x
= (3*size
.y
) / 2 + 2;
111 size
.y
= (3*size
.x
) / 2 + 2;
118 // ----------------------------------------------------------------------------
120 // ----------------------------------------------------------------------------
122 wxBorder
wxGauge::GetDefaultBorder() const
124 return wxBORDER_STATIC
;
127 void wxGauge::DoDraw(wxControlRenderer
*renderer
)
129 renderer
->DrawProgressBar(this);
132 #endif // wxUSE_GAUGE