From 3a93889c3cd3fa1a91d30255f840015b92018660 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 24 Sep 2002 10:39:23 +0000 Subject: [PATCH] Remove the check for editable. (Reported by Brent Fox) Thu Aug 8 16:58:22 2002 Owen Taylor * gtk/gtkspinbutton.c (gtk_spin_button_real_change_value): Remove the check for editable. (Reported by Brent Fox) --- ChangeLog | 5 ++ ChangeLog.pre-2-10 | 5 ++ ChangeLog.pre-2-2 | 5 ++ ChangeLog.pre-2-4 | 5 ++ ChangeLog.pre-2-6 | 5 ++ ChangeLog.pre-2-8 | 5 ++ gtk/gtkspinbutton.c | 146 ++++++++++++++++++++++---------------------- 7 files changed, 104 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index f51191f59d..b3bafcfc27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Aug 8 16:58:22 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_real_change_value): + Remove the check for editable. (Reported by Brent Fox) + Tue Sep 24 06:17:37 2002 Owen Taylor * gtk/gtkeventbox.c (gtk_event_box_paint): Honor diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f51191f59d..b3bafcfc27 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Thu Aug 8 16:58:22 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_real_change_value): + Remove the check for editable. (Reported by Brent Fox) + Tue Sep 24 06:17:37 2002 Owen Taylor * gtk/gtkeventbox.c (gtk_event_box_paint): Honor diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f51191f59d..b3bafcfc27 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Thu Aug 8 16:58:22 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_real_change_value): + Remove the check for editable. (Reported by Brent Fox) + Tue Sep 24 06:17:37 2002 Owen Taylor * gtk/gtkeventbox.c (gtk_event_box_paint): Honor diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f51191f59d..b3bafcfc27 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Thu Aug 8 16:58:22 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_real_change_value): + Remove the check for editable. (Reported by Brent Fox) + Tue Sep 24 06:17:37 2002 Owen Taylor * gtk/gtkeventbox.c (gtk_event_box_paint): Honor diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f51191f59d..b3bafcfc27 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Thu Aug 8 16:58:22 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_real_change_value): + Remove the check for editable. (Reported by Brent Fox) + Tue Sep 24 06:17:37 2002 Owen Taylor * gtk/gtkeventbox.c (gtk_event_box_paint): Honor diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f51191f59d..b3bafcfc27 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Thu Aug 8 16:58:22 2002 Owen Taylor + + * gtk/gtkspinbutton.c (gtk_spin_button_real_change_value): + Remove the check for editable. (Reported by Brent Fox) + Tue Sep 24 06:17:37 2002 Owen Taylor * gtk/gtkeventbox.c (gtk_event_box_paint): Honor diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index ac12478a16..d9922f997c 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -1220,81 +1220,83 @@ static void gtk_spin_button_real_change_value (GtkSpinButton *spin, GtkScrollType scroll) { - if (GTK_ENTRY (spin)->editable) + /* We don't test whether the entry is editable, since + * this key binding conceptually corresponds to changing + * the value with the buttons using the mouse, which + * we allow for non-editable spin buttons. + */ + switch (scroll) { - switch (scroll) - { - case GTK_SCROLL_STEP_BACKWARD: - case GTK_SCROLL_STEP_DOWN: - case GTK_SCROLL_STEP_LEFT: - gtk_spin_button_real_spin (spin, -spin->timer_step); - - if (spin->climb_rate > 0.0 && spin->timer_step - < spin->adjustment->page_increment) - { - if (spin->timer_calls < MAX_TIMER_CALLS) - spin->timer_calls++; - else - { - spin->timer_calls = 0; - spin->timer_step += spin->climb_rate; - } - } - break; - - case GTK_SCROLL_STEP_FORWARD: - case GTK_SCROLL_STEP_UP: - case GTK_SCROLL_STEP_RIGHT: - gtk_spin_button_real_spin (spin, spin->timer_step); - - if (spin->climb_rate > 0.0 && spin->timer_step - < spin->adjustment->page_increment) - { - if (spin->timer_calls < MAX_TIMER_CALLS) - spin->timer_calls++; - else - { - spin->timer_calls = 0; - spin->timer_step += spin->climb_rate; - } - } - break; - - case GTK_SCROLL_PAGE_BACKWARD: - case GTK_SCROLL_PAGE_DOWN: - case GTK_SCROLL_PAGE_LEFT: - gtk_spin_button_real_spin (spin, -spin->adjustment->page_increment); - break; - - case GTK_SCROLL_PAGE_FORWARD: - case GTK_SCROLL_PAGE_UP: - case GTK_SCROLL_PAGE_RIGHT: - gtk_spin_button_real_spin (spin, spin->adjustment->page_increment); - break; - - case GTK_SCROLL_START: - { - gdouble diff = spin->adjustment->value - spin->adjustment->lower; - if (diff > EPSILON) - gtk_spin_button_real_spin (spin, -diff); - break; - } - - case GTK_SCROLL_END: - { - gdouble diff = spin->adjustment->upper - spin->adjustment->value; - if (diff > EPSILON) - gtk_spin_button_real_spin (spin, diff); - break; - } - - default: - g_warning ("Invalid scroll type %d for GtkSpinButton::change-value", scroll); - break; - } + case GTK_SCROLL_STEP_BACKWARD: + case GTK_SCROLL_STEP_DOWN: + case GTK_SCROLL_STEP_LEFT: + gtk_spin_button_real_spin (spin, -spin->timer_step); - gtk_spin_button_update (spin); + if (spin->climb_rate > 0.0 && spin->timer_step + < spin->adjustment->page_increment) + { + if (spin->timer_calls < MAX_TIMER_CALLS) + spin->timer_calls++; + else + { + spin->timer_calls = 0; + spin->timer_step += spin->climb_rate; + } + } + break; + + case GTK_SCROLL_STEP_FORWARD: + case GTK_SCROLL_STEP_UP: + case GTK_SCROLL_STEP_RIGHT: + gtk_spin_button_real_spin (spin, spin->timer_step); + + if (spin->climb_rate > 0.0 && spin->timer_step + < spin->adjustment->page_increment) + { + if (spin->timer_calls < MAX_TIMER_CALLS) + spin->timer_calls++; + else + { + spin->timer_calls = 0; + spin->timer_step += spin->climb_rate; + } + } + break; + + case GTK_SCROLL_PAGE_BACKWARD: + case GTK_SCROLL_PAGE_DOWN: + case GTK_SCROLL_PAGE_LEFT: + gtk_spin_button_real_spin (spin, -spin->adjustment->page_increment); + break; + + case GTK_SCROLL_PAGE_FORWARD: + case GTK_SCROLL_PAGE_UP: + case GTK_SCROLL_PAGE_RIGHT: + gtk_spin_button_real_spin (spin, spin->adjustment->page_increment); + break; + + case GTK_SCROLL_START: + { + gdouble diff = spin->adjustment->value - spin->adjustment->lower; + if (diff > EPSILON) + gtk_spin_button_real_spin (spin, -diff); + break; + } + + case GTK_SCROLL_END: + { + gdouble diff = spin->adjustment->upper - spin->adjustment->value; + if (diff > EPSILON) + gtk_spin_button_real_spin (spin, diff); + break; + } + + default: + g_warning ("Invalid scroll type %d for GtkSpinButton::change-value", scroll); + break; } + + gtk_spin_button_update (spin); } static gint