X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c7ce073474469e25aedb6c203fdb6f549d18870..60372b0d54379701d62edf5595a7dc25c48330e1:/src/osx/slider_osx.cpp diff --git a/src/osx/slider_osx.cpp b/src/osx/slider_osx.cpp index 705ec7db94..b306575842 100644 --- a/src/osx/slider_osx.cpp +++ b/src/osx/slider_osx.cpp @@ -16,8 +16,6 @@ #include "wx/slider.h" #include "wx/osx/private.h" -IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) - BEGIN_EVENT_TABLE(wxSlider, wxControl) END_EVENT_TABLE() @@ -59,9 +57,9 @@ bool wxSlider::Create(wxWindow *parent, const wxSize& size, long style, const wxValidator& validator, const wxString& name) -{ - m_macIsUserPane = false; - +{ + DontCreatePeer(); + m_macMinimumStatic = NULL; m_macMaximumStatic = NULL; m_macValueStatic = NULL; @@ -105,7 +103,7 @@ bool wxSlider::Create(wxWindow *parent, if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) return false; - m_peer = wxWidgetImpl::CreateSlider( this, parent, id, value, minValue, maxValue, pos, size, style, GetExtraStyle() ); + SetPeer(wxWidgetImpl::CreateSlider( this, parent, id, value, minValue, maxValue, pos, size, style, GetExtraStyle() )); if (style & wxSL_VERTICAL) // Forces SetSize to use the proper width @@ -148,7 +146,7 @@ wxSlider::~wxSlider() int wxSlider::GetValue() const { // We may need to invert the value returned by the widget - return ValueInvertOrNot( m_peer->GetValue() ) ; + return ValueInvertOrNot( GetPeer()->GetValue() ) ; } void wxSlider::SetValue(int value) @@ -161,7 +159,7 @@ void wxSlider::SetValue(int value) } // We only invert for the setting of the actual native widget - m_peer->SetValue( ValueInvertOrNot( value ) ); + GetPeer()->SetValue( ValueInvertOrNot( value ) ); } void wxSlider::SetRange(int minValue, int maxValue) @@ -177,8 +175,8 @@ void wxSlider::SetRange(int minValue, int maxValue) m_rangeMin = minValue; m_rangeMax = maxValue; - m_peer->SetMinimum( m_rangeMin ); - m_peer->SetMaximum( m_rangeMax ); + GetPeer()->SetMinimum( m_rangeMin ); + GetPeer()->SetMaximum( m_rangeMax ); if (m_macMinimumStatic) { @@ -208,7 +206,7 @@ void wxSlider::SetRange(int minValue, int maxValue) } // For trackbars only -void wxSlider::SetTickFreq(int n, int WXUNUSED(pos)) +void wxSlider::DoSetTickFreq(int n) { // TODO m_tickFreq = n; @@ -290,7 +288,7 @@ void wxSlider::TriggerScrollEvent( wxEventType scrollEvent) { // Whatever the native value is, we may need to invert it for calling // SetValue and putting the possibly inverted value in the event - int value = ValueInvertOrNot( m_peer->GetValue() ); + int value = ValueInvertOrNot( GetPeer()->GetValue() ); SetValue( value ); @@ -438,7 +436,7 @@ void wxSlider::DoSetSize(int x, int y, int w, int h, int sizeFlags) if (GetWindowStyle() & wxSL_VERTICAL) // If vertical, use current value - text.Printf(wxT("%d"), (int)m_peer->GetValue()); + text.Printf(wxT("%d"), (int)GetPeer()->GetValue()); else // Use max so that the current value doesn't drift as centering would need to change text.Printf(wxT("%d"), m_rangeMax);