X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/845a6bbf743a33a1975827f517fbd667c13ef6ac..46405e36bf9962b251e77e5048e96bf6a54edb15:/src/gtk/spinctrl.cpp?ds=sidebyside diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index bae8e7ea5b..d84c02d39d 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -185,7 +185,7 @@ double wxSpinCtrlGTKBase::DoGetIncrement() const wxCHECK_MSG( (m_widget != NULL), 0, wxT("invalid spin button") ); double inc = 0; - gtk_spin_button_get_increments( GTK_SPIN_BUTTON(m_widget), NULL, &inc); + gtk_spin_button_get_increments( GTK_SPIN_BUTTON(m_widget), &inc, NULL); return inc; } @@ -218,9 +218,6 @@ void wxSpinCtrlGTKBase::DoSetValue( double value ) { wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") ); - if (wxIsKindOf(this, wxSpinCtrl)) - value = wxRound( value ); - GtkDisableEvents(); gtk_spin_button_set_value( GTK_SPIN_BUTTON(m_widget), value); GtkEnableEvents(); @@ -260,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(); }