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