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
This commit is contained in:
Stefan Csomor 2006-01-20 17:15:15 +00:00
parent fec4df061a
commit 8cba326d4e

View File

@ -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 ) ;