]> git.saurik.com Git - wxWidgets.git/blame - src/mac/gauge.cpp
added option for getting visible region w/o children clipped, added to redrawing...
[wxWidgets.git] / src / mac / gauge.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: gauge.cpp
3// Purpose: wxGauge class
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "gauge.h"
14#endif
15
16#include "wx/gauge.h"
17
2f1ae414 18#if !USE_SHARED_LIBRARY
e9576ca5 19IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
2f1ae414 20#endif
e9576ca5 21
d497dca4 22#include "wx/mac/uma.h"
519cb848 23
e9576ca5
SC
24bool wxGauge::Create(wxWindow *parent, wxWindowID id,
25 int range,
26 const wxPoint& pos,
519cb848 27 const wxSize& s,
e9576ca5
SC
28 long style,
29 const wxValidator& validator,
30 const wxString& name)
31{
519cb848
SC
32 wxSize size = s ;
33 Rect bounds ;
34 Str255 title ;
35 m_rangeMax = range ;
e6c1d9af 36 m_gaugePos = 0 ;
519cb848
SC
37
38 if ( size.x == wxDefaultSize.x && size.y == wxDefaultSize.y)
39 {
40 size = wxSize( 200 , 16 ) ;
41 }
42
2f1ae414 43 MacPreControlCreate( parent , id , "" , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
519cb848 44
76a5e5d2 45 m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range,
519cb848
SC
46 kControlProgressBarProc , (long) this ) ;
47
48 MacPostControlCreate() ;
49
50 return TRUE;
e9576ca5
SC
51}
52
53void wxGauge::SetShadowWidth(int w)
54{
e9576ca5
SC
55}
56
57void wxGauge::SetBezelFace(int w)
58{
e9576ca5
SC
59}
60
61void wxGauge::SetRange(int r)
62{
63 m_rangeMax = r;
76a5e5d2 64 ::SetControlMaximum( (ControlHandle) m_macControl , m_rangeMax ) ;
e9576ca5
SC
65}
66
67void wxGauge::SetValue(int pos)
68{
69 m_gaugePos = pos;
76a5e5d2 70 ::SetControlValue( (ControlHandle) m_macControl , m_gaugePos ) ;
e9576ca5
SC
71}
72
73int wxGauge::GetShadowWidth() const
74{
e9576ca5
SC
75 return 0;
76}
77
78int wxGauge::GetBezelFace() const
79{
e9576ca5
SC
80 return 0;
81}
82
83int wxGauge::GetRange() const
84{
85 return m_rangeMax;
86}
87
88int wxGauge::GetValue() const
89{
90 return m_gaugePos;
91}
92