Ryan's patch 1467727 , removing the SetValue from SetRange when not needed and some cleanups

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2006-04-11 05:45:31 +00:00
parent 2d6a2f1d78
commit 786a9df157

View File

@ -204,7 +204,16 @@ void wxSlider::SetRange(int minValue, int maxValue)
m_macMaximumStatic->SetLabel( value ); m_macMaximumStatic->SetLabel( value );
} }
SetValue( m_rangeMin ); // If the range is out of bounds, set it to a
// value that is within bounds
// RN: Testing reveals OSX does its own
// bounding, perhaps this isn't needed?
int currentValue = GetValue();
if(currentValue < m_rangeMin)
SetValue(m_rangeMin);
else if(currentValue > m_rangeMax)
SetValue(m_rangeMax);
} }
// For trackbars only // For trackbars only
@ -294,19 +303,14 @@ void wxSlider::MacHandleControlClick( WXWidget control, wxInt16 controlpart, boo
SetValue( value ); SetValue( value );
wxEventType scrollEvent = wxEVT_NULL; wxScrollEvent event( wxEVT_SCROLL_THUMBTRACK, m_windowId );
event.SetPosition( value );
scrollEvent = wxEVT_SCROLL_THUMBTRACK;
wxScrollEvent event(scrollEvent, m_windowId);
event.SetPosition(value);
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent( event );
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId );
cevent.SetInt( value ); cevent.SetInt( value );
cevent.SetEventObject( this ); cevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( cevent ); GetEventHandler()->ProcessEvent( cevent );
} }
@ -318,14 +322,10 @@ wxInt32 wxSlider::MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF mevent )
SetValue( value ) ; SetValue( value ) ;
wxEventType scrollEvent = wxEVT_NULL ; wxScrollEvent event( wxEVT_SCROLL_THUMBRELEASE, m_windowId );
event.SetPosition( value );
scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
wxScrollEvent event(scrollEvent, m_windowId);
event.SetPosition(value);
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent( event );
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId );
cevent.SetInt( value ); cevent.SetInt( value );