X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6cd56f6e0fc7ff60ca6c7bfb30a4d1eaa0fa5eef..b3cec67186d678d2c3985923bdb8c787455cf369:/src/osx/slider_osx.cpp?ds=sidebyside diff --git a/src/osx/slider_osx.cpp b/src/osx/slider_osx.cpp index c0e980c376..cfa7fffc51 100644 --- a/src/osx/slider_osx.cpp +++ b/src/osx/slider_osx.cpp @@ -22,8 +22,8 @@ BEGIN_EVENT_TABLE(wxSlider, wxControl) END_EVENT_TABLE() // The dimensions of the different styles of sliders (from Aqua document) -#ifdef wxOSX_USE_COCOA - #define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 25 +#if wxOSX_USE_COCOA + #define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 28 #define wxSLIDER_DIMENSIONACROSS_ARROW 21 #else #define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24 @@ -186,9 +186,9 @@ void wxSlider::SetRange(int minValue, int maxValue) m_macMaximumStatic->SetLabel( value ); } - // If the range is out of bounds, set it to a + // If the range is out of bounds, set it to a // value that is within bounds - // RN: Testing reveals OSX does its own + // RN: Testing reveals OSX does its own // bounding, perhaps this isn't needed? int currentValue = GetValue(); @@ -277,9 +277,7 @@ void wxSlider::Command(wxCommandEvent &event) ProcessCommand(event); } -void wxSlider::MacHandleControlClick(WXWidget WXUNUSED(control), - wxInt16 WXUNUSED(controlpart), - bool WXUNUSED(mouseStillDown)) +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 @@ -287,7 +285,7 @@ void wxSlider::MacHandleControlClick(WXWidget WXUNUSED(control), SetValue( value ); - wxScrollEvent event( wxEVT_SCROLL_THUMBTRACK, m_windowId ); + wxScrollEvent event( scrollEvent, m_windowId ); event.SetPosition( value ); event.SetEventObject( this ); HandleWindowEvent( event ); @@ -298,24 +296,9 @@ void wxSlider::MacHandleControlClick(WXWidget WXUNUSED(control), HandleWindowEvent( cevent ); } -bool wxSlider::HandleClicked( double timestampsec ) +bool wxSlider::OSXHandleClicked( double WXUNUSED(timestampsec) ) { - // 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() ) ; - - SetValue( value ) ; - - wxScrollEvent event( wxEVT_SCROLL_THUMBRELEASE, m_windowId ); - event.SetPosition( value ); - event.SetEventObject( this ); - HandleWindowEvent( event ); - - wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); - cevent.SetInt( value ); - cevent.SetEventObject( this ); - - HandleWindowEvent( cevent ); + TriggerScrollEvent(wxEVT_SCROLL_THUMBRELEASE); return true; }