From 5e9b80221a9845a19e3f6f4a3e80e841929d31c0 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Tue, 10 Jan 2012 17:09:11 +0000 Subject: [PATCH] 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 --- src/msw/slider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/slider.cpp b/src/msw/slider.cpp index 747d5e309b..23e8f0ac87 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 -- 2.47.2