X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..6e7d2550cecf6c13b6f76e7e43da93744ad773b8:/src/osx/slider_osx.cpp diff --git a/src/osx/slider_osx.cpp b/src/osx/slider_osx.cpp index 45b335899d..6a7810e00c 100644 --- a/src/osx/slider_osx.cpp +++ b/src/osx/slider_osx.cpp @@ -22,8 +22,13 @@ BEGIN_EVENT_TABLE(wxSlider, wxControl) END_EVENT_TABLE() // The dimensions of the different styles of sliders (from Aqua document) -#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24 -#define wxSLIDER_DIMENSIONACROSS_ARROW 18 +#ifdef wxOSX_USE_COCOA + #define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 28 + #define wxSLIDER_DIMENSIONACROSS_ARROW 21 +#else + #define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24 + #define wxSLIDER_DIMENSIONACROSS_ARROW 18 +#endif // Distance between slider and text #define wxSLIDER_BORDERTEXT 5 @@ -272,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 @@ -282,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 ); @@ -293,25 +296,10 @@ 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; }