X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/43524b1583cbe798351fef03242f0990e1cfddc2..82cddbd97a4dfbd0dcf5c44c9336173d6dd386ef:/src/mac/carbon/spinbutt.cpp diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp index 560ab64352..02ed2e9423 100644 --- a/src/mac/carbon/spinbutt.cpp +++ b/src/mac/carbon/spinbutt.cpp @@ -124,11 +124,16 @@ void wxSpinButton::MacHandleValueChanged( int inc ) else scrollEvent = wxEVT_SCROLL_THUMBTRACK; + // Do not send an event if the value has not actually changed + // (Also works for wxSpinCtrl) + if ( m_value == oldValue ) + return; + wxSpinEvent event( scrollEvent, m_windowId ); event.SetPosition( m_value ); event.SetEventObject( this ); - if ((GetEventHandler()->ProcessEvent( event )) && !event.IsAllowed()) + if ((HandleWindowEvent( event )) && !event.IsAllowed()) m_value = oldValue; m_peer->SetValue( m_value ); @@ -140,11 +145,13 @@ void wxSpinButton::MacHandleValueChanged( int inc ) wxSpinEvent event2( scrollEvent, GetId() ); event2.SetPosition( m_value ); event2.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event2 ); + HandleWindowEvent( event2 ); } } -void wxSpinButton::MacHandleControlClick( WXWidget control, wxInt16 controlpart, bool mouseStillDown ) +void wxSpinButton::MacHandleControlClick(WXWidget WXUNUSED(control), + wxInt16 controlpart, + bool WXUNUSED(mouseStillDown)) { int nScrollInc = 0; @@ -165,7 +172,8 @@ void wxSpinButton::MacHandleControlClick( WXWidget control, wxInt16 controlpart, MacHandleValueChanged( nScrollInc ) ; } -wxInt32 wxSpinButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF event ) +wxInt32 wxSpinButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler), + WXEVENTREF WXUNUSED(event)) { #if 0 // these have been handled by the live action proc already