X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/70231bce2d6387a79396906f8743a3af70d751c0..524c47aa3adf2af11a3069fd5da035a604f08f66:/src/osx/gauge_osx.cpp diff --git a/src/osx/gauge_osx.cpp b/src/osx/gauge_osx.cpp new file mode 100644 index 0000000000..426e858daa --- /dev/null +++ b/src/osx/gauge_osx.cpp @@ -0,0 +1,75 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/osx/gauge_osx.cpp +// Purpose: wxGauge class +// Author: Stefan Csomor +// Modified by: +// Created: 1998-01-01 +// RCS-ID: $Id: gauge.cpp 54820 2008-07-29 20:04:11Z SC $ +// Copyright: (c) Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#if wxUSE_GAUGE + +#include "wx/gauge.h" + +IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl) + +#include "wx/osx/private.h" + +bool wxGauge::Create( wxWindow *parent, + wxWindowID id, + int range, + const wxPoint& pos, + const wxSize& s, + long style, + const wxValidator& validator, + const wxString& name ) +{ + m_macIsUserPane = false; + + if ( !wxGaugeBase::Create( parent, id, range, pos, s, style & 0xE0FFFFFF, validator, name ) ) + return false; + + wxSize size = s; + + m_peer = wxWidgetImpl::CreateGauge( this, parent, id, GetValue() , 0, GetRange(), pos, size, style, GetExtraStyle() ); + + MacPostControlCreate( pos, size ); + + return true; +} + +void wxGauge::SetRange(int r) +{ + // we are going via the base class in case there is + // some change behind the values by it + wxGaugeBase::SetRange( r ) ; + if ( m_peer ) + m_peer->SetMaximum( GetRange() ) ; +} + +void wxGauge::SetValue(int pos) +{ + // we are going via the base class in case there is + // some change behind the values by it + wxGaugeBase::SetValue( pos ) ; + + if ( m_peer ) + m_peer->SetValue( GetValue() ) ; +} + +int wxGauge::GetValue() const +{ + return m_gaugePos ; +} + +void wxGauge::Pulse() +{ + m_peer->PulseGauge(); +} + +#endif // wxUSE_GAUGE +