X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..43c5b6e808f083617eb42cb48e77366844f8fb5c:/src/osx/carbon/spinbutt.cpp?ds=sidebyside diff --git a/src/osx/carbon/spinbutt.cpp b/src/osx/carbon/spinbutt.cpp index 2f6fc34266..219d9f5c1b 100644 --- a/src/osx/carbon/spinbutt.cpp +++ b/src/osx/carbon/spinbutt.cpp @@ -40,75 +40,4 @@ wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer, return peer ; } -void wxSpinButton::MacHandleControlClick(WXWidget WXUNUSED(control), - wxInt16 controlpart, - bool WXUNUSED(mouseStillDown)) -{ - int inc = 0; - - switch ( controlpart ) - { - case kControlUpButtonPart : - inc = 1; - break; - - case kControlDownButtonPart : - inc = -1; - break; - - default: - break; - } - - // trigger scroll events - - wxEventType scrollEvent = wxEVT_NULL; - int oldValue = GetValue() ; - - int newValue = oldValue + inc; - - if (newValue < m_min) - { - if ( m_windowStyle & wxSP_WRAP ) - newValue = m_max; - else - newValue = m_min; - } - - if (newValue > m_max) - { - if ( m_windowStyle & wxSP_WRAP ) - newValue = m_min; - else - newValue = m_max; - } - - if ( newValue - oldValue == -1 ) - scrollEvent = wxEVT_SCROLL_LINEDOWN; - else if ( newValue - oldValue == 1 ) - scrollEvent = wxEVT_SCROLL_LINEUP; - else - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - - // Do not send an event if the value has not actually changed - // (Also works for wxSpinCtrl) - if ( newValue == oldValue ) - return; - - if ( scrollEvent != wxEVT_SCROLL_THUMBTRACK ) - { - wxSpinEvent event( scrollEvent, m_windowId ); - - event.SetPosition( newValue ); - event.SetEventObject( this ); - if ((HandleWindowEvent( event )) && !event.IsAllowed()) - newValue = oldValue; - } - - m_peer->SetValue( newValue ); - - // always send a thumbtrack event - SendThumbTrackEvent() ; -} - #endif // wxUSE_SPINBTN