From: Stefan Csomor Date: Fri, 20 Jan 2006 17:15:15 +0000 (+0000) Subject: allow for a range value of SInt32 instead of SInt16 X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8cba326d4e535617889e49d7f50509dd60523688 allow for a range value of SInt32 instead of SInt16 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/slider.cpp b/src/mac/carbon/slider.cpp index 6080397266..559b37eaba 100644 --- a/src/mac/carbon/slider.cpp +++ b/src/mac/carbon/slider.cpp @@ -108,17 +108,18 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, // NB: (RN) Ticks here are sometimes off in the GUI if there // is not as many ticks as there are values // - UInt16 tickMarks = 0 ; + int tickMarks = 0 ; if ( style & wxSL_AUTOTICKS ) tickMarks = (maxValue - minValue) + 1; //+1 for the 0 value - // keep the number of tickmarks from becoming unwieldly + // keep the number of tickmarks from becoming unwieldly, therefore below it is ok to cast + // it to a UInt16 while (tickMarks > 20) tickMarks /= 5; m_peer = new wxMacControl( this ); verify_noerr ( CreateSliderControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , - value , minValue , maxValue , kControlSliderPointsDownOrRight , tickMarks , true /* liveTracking */ , + value , minValue , maxValue , kControlSliderPointsDownOrRight , (UInt16) tickMarks , true /* liveTracking */ , GetwxMacLiveScrollbarActionProc() , m_peer->GetControlRefAddr() ) ); if (style & wxSL_VERTICAL) @@ -284,7 +285,7 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart, bo { // Whatever the native value is, we may need to invert it for calling // SetValue and putting the possibly inverted value in the event - SInt16 value = ValueInvertOrNot ( m_peer->GetValue() ) ; + int value = ValueInvertOrNot ( m_peer->GetValue() ) ; SetValue( value ) ; @@ -308,7 +309,7 @@ wxInt32 wxSlider::MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF mevent ) { // Whatever the native value is, we may need to invert it for calling // SetValue and putting the possibly inverted value in the event - SInt16 value = ValueInvertOrNot ( m_peer->GetValue() ) ; + int value = ValueInvertOrNot ( m_peer->GetValue() ) ; SetValue( value ) ;