]> git.saurik.com Git - wxWidgets.git/blame - src/mac/gauge.cpp
OGL: misc.cpp clashes with misc.c frim iODBC, therefore
[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
e9576ca5 18IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
e9576ca5 19
519cb848
SC
20#include <wx/mac/uma.h>
21
e9576ca5
SC
22bool wxGauge::Create(wxWindow *parent, wxWindowID id,
23 int range,
24 const wxPoint& pos,
519cb848 25 const wxSize& s,
e9576ca5
SC
26 long style,
27 const wxValidator& validator,
28 const wxString& name)
29{
519cb848
SC
30 wxSize size = s ;
31 Rect bounds ;
32 Str255 title ;
33 m_rangeMax = range ;
34 m_macHorizontalBorder = 2 ; // additional pixels around the real control
35 m_macVerticalBorder = 2 ;
36
37 if ( size.x == wxDefaultSize.x && size.y == wxDefaultSize.y)
38 {
39 size = wxSize( 200 , 16 ) ;
40 }
41
42 MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
43
44 m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , range,
45 kControlProgressBarProc , (long) this ) ;
46
47 MacPostControlCreate() ;
48
49 return TRUE;
e9576ca5
SC
50}
51
52void wxGauge::SetShadowWidth(int w)
53{
e9576ca5
SC
54}
55
56void wxGauge::SetBezelFace(int w)
57{
e9576ca5
SC
58}
59
60void wxGauge::SetRange(int r)
61{
62 m_rangeMax = r;
519cb848 63 ::SetControlMaximum( m_macControl , m_rangeMax ) ;
e9576ca5
SC
64}
65
66void wxGauge::SetValue(int pos)
67{
68 m_gaugePos = pos;
519cb848 69 ::SetControlValue( m_macControl , m_gaugePos ) ;
e9576ca5
SC
70}
71
72int wxGauge::GetShadowWidth() const
73{
e9576ca5
SC
74 return 0;
75}
76
77int wxGauge::GetBezelFace() const
78{
e9576ca5
SC
79 return 0;
80}
81
82int wxGauge::GetRange() const
83{
84 return m_rangeMax;
85}
86
87int wxGauge::GetValue() const
88{
89 return m_gaugePos;
90}
91