]> git.saurik.com Git - wxWidgets.git/commitdiff
Preserve page size when changing increment in wxGTK wxSpinCtrlDouble.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 29 Sep 2010 13:46:19 +0000 (13:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 29 Sep 2010 13:46:19 +0000 (13:46 +0000)
The page size was wrongly reset when changing the increment before.

See #12342.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/spinctrl.cpp

index 2d48ca16dce936ec8f79b22e229c8079881172c2..d84c02d39d8332aa960a4a0db4ee8881c18d0631 100644 (file)
@@ -257,7 +257,12 @@ void wxSpinCtrlGTKBase::DoSetIncrement(double inc)
     wxCHECK_RET( m_widget, "invalid spin button" );
 
     GtkDisableEvents();
-    gtk_spin_button_set_increments( GTK_SPIN_BUTTON(m_widget), inc, 10*inc);
+
+    // Preserve the old page value when changing just the increment.
+    double page = 10*inc;
+    gtk_spin_button_get_increments( GTK_SPIN_BUTTON(m_widget), NULL, &page);
+
+    gtk_spin_button_set_increments( GTK_SPIN_BUTTON(m_widget), inc, page);
     GtkEnableEvents();
 }