]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed clicking on MSW slider not changing value with small ranges.
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Tue, 10 Jan 2012 17:09:11 +0000 (17:09 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Tue, 10 Jan 2012 17:09:11 +0000 (17:09 +0000)
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

src/msw/slider.cpp

index 747d5e309becdb5520e45d159d9dc6701f4ba889..23e8f0ac877e7dbeb2939115b7ab0ca68c2a8d61 100644 (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