Fixed clicking on MSW slider not changing value with small ranges.

If the range was 9 or less the SetPageSize call would pass a page size of 0, resulting in the value not being changed when clicking on the slider area (outside the thumb). Fix this by at least passing a page size of 1 to SetPageSize.

Closes #1608.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2012-01-10 17:09:11 +00:00
parent 102db80fb5
commit 5e9b80221a

View File

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