]> git.saurik.com Git - wxWidgets.git/blame - src/mac/classic/gauge.cpp
don't cast from float to int (provoking a warning) just to cast back to float again
[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
2646f485
SC
12#include "wx/gauge.h"
13
2646f485 14IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
2646f485
SC
15
16#include "wx/mac/uma.h"
17
18bool wxGauge::Create(wxWindow *parent, wxWindowID id,
19 int range,
20 const wxPoint& pos,
21 const wxSize& s,
22 long style,
23 const wxValidator& validator,
24 const wxString& name)
25{
26 if ( !wxGaugeBase::Create(parent, id, range, pos, s, style, validator, name) )
27 return false;
28
29 wxSize size = s ;
30 Rect bounds ;
31 Str255 title ;
32 m_rangeMax = range ;
33 m_gaugePos = 0 ;
34
422d0ff0 35 if ( size.x == wxDefaultCoord && size.y == wxDefaultCoord)
2646f485
SC
36 {
37 size = wxSize( 200 , 16 ) ;
38 }
39
40 MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
41
6bc3b8e9 42 m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range,
2646f485
SC
43 kControlProgressBarProc , (long) this ) ;
44
45 MacPostControlCreate() ;
46
47 return TRUE;
48}
49
50void wxGauge::SetShadowWidth(int w)
51{
52}
53
54void wxGauge::SetBezelFace(int w)
55{
56}
57
58void wxGauge::SetRange(int r)
59{
60 m_rangeMax = r;
61 ::SetControl32BitMaximum( (ControlHandle) m_macControl , m_rangeMax ) ;
62}
63
64void wxGauge::SetValue(int pos)
65{
66 m_gaugePos = pos;
67 ::SetControl32BitValue( (ControlHandle) m_macControl , m_gaugePos ) ;
68}
69
70int wxGauge::GetShadowWidth() const
71{
72 return 0;
73}
74
75int wxGauge::GetBezelFace() const
76{
77 return 0;
78}
79
80int wxGauge::GetRange() const
81{
82 return m_rangeMax;
83}
84
85int wxGauge::GetValue() const
86{
87 return m_gaugePos;
88}
89