]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/gauge.cpp
Cleanup
[wxWidgets.git] / src / mac / carbon / gauge.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: gauge.cpp
3// Purpose: wxGauge class
a31a5f85 4// Author: Stefan Csomor
e9576ca5 5// Modified by:
a31a5f85 6// Created: 1998-01-01
e9576ca5 7// RCS-ID: $Id$
a31a5f85 8// Copyright: (c) Stefan Csomor
e40298d5 9// Licence: wxWindows licence
e9576ca5
SC
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{
facd6764
SC
32 m_macIsUserPane = FALSE ;
33
34 if ( !wxGaugeBase::Create(parent, id, range, pos, s, style & 0xE0FFFFFF, validator, name) )
b45ed7a2
VZ
35 return false;
36
e40298d5 37 wxSize size = s ;
facd6764 38
e40298d5
JS
39 m_rangeMax = range ;
40 m_gaugePos = 0 ;
41
42 if ( size.x == wxDefaultSize.x && size.y == wxDefaultSize.y)
43 {
44 size = wxSize( 200 , 16 ) ;
45 }
46
facd6764
SC
47 Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
48 m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , 0 , range,
e40298d5
JS
49 kControlProgressBarProc , (long) this ) ;
50
facd6764 51 MacPostControlCreate(pos,size) ;
e40298d5
JS
52
53 return TRUE;
e9576ca5
SC
54}
55
56void wxGauge::SetShadowWidth(int w)
57{
e9576ca5
SC
58}
59
60void wxGauge::SetBezelFace(int w)
61{
e9576ca5
SC
62}
63
64void wxGauge::SetRange(int r)
65{
66 m_rangeMax = r;
facd6764 67 ::SetControl32BitMaximum( (ControlRef) m_macControl , m_rangeMax ) ;
e9576ca5
SC
68}
69
70void wxGauge::SetValue(int pos)
71{
72 m_gaugePos = pos;
facd6764 73 ::SetControl32BitValue( (ControlRef) m_macControl , m_gaugePos ) ;
e9576ca5
SC
74}
75
76int wxGauge::GetShadowWidth() const
77{
e9576ca5
SC
78 return 0;
79}
80
81int wxGauge::GetBezelFace() const
82{
e9576ca5
SC
83 return 0;
84}
85
86int wxGauge::GetRange() const
87{
88 return m_rangeMax;
89}
90
91int wxGauge::GetValue() const
92{
93 return m_gaugePos;
94}
95