X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4235f9f6c601cae95fc74a663b1dc47c40c21582..43c42c18d36c703a88b1b7b697bac27fe5608eca:/src/msw/slider.cpp?ds=sidebyside diff --git a/src/msw/slider.cpp b/src/msw/slider.cpp index 747d5e309b..8b905b1fa5 100644 --- a/src/msw/slider.cpp +++ b/src/msw/slider.cpp @@ -175,7 +175,7 @@ bool wxSlider::Create(wxWindow *parent, // and initialize everything SetRange(minValue, maxValue); SetValue(value); - SetPageSize((maxValue - minValue)/10); + SetPageSize( wxMax(1, (maxValue - minValue)/10) ); // we need to position the labels correctly if we have them and if // SetSize() hadn't been called before (when best size was determined by @@ -310,7 +310,7 @@ bool wxSlider::MSWOnScroll(int WXUNUSED(orientation), event.SetEventObject( this ); HandleWindowEvent(event); - wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() ); + wxCommandEvent cevent( wxEVT_SLIDER, GetId() ); cevent.SetInt( newPos ); cevent.SetEventObject( this ); @@ -583,7 +583,7 @@ void wxSlider::SetValue(int value) if ( m_labels ) { - ::SetWindowText((*m_labels)[SliderLabel_Value], Format(value).wx_str()); + ::SetWindowText((*m_labels)[SliderLabel_Value], Format(value).t_str()); } } @@ -603,9 +603,9 @@ void wxSlider::SetRange(int minValue, int maxValue) if ( m_labels ) { ::SetWindowText((*m_labels)[SliderLabel_Min], - Format(ValueInvertOrNot(m_rangeMin)).wx_str()); + Format(ValueInvertOrNot(m_rangeMin)).t_str()); ::SetWindowText((*m_labels)[SliderLabel_Max], - Format(ValueInvertOrNot(m_rangeMax)).wx_str()); + Format(ValueInvertOrNot(m_rangeMax)).t_str()); } // When emulating wxSL_INVERSE style in wxWidgets, we need to update the