Added support for wheel mice (buttons 4 and 5).

Sun Nov 21 16:44:35 1999  Stefan Jeske  <stefan@gtk.org>

        * gtk/gtkspinbutton.c (gtk_spin_button_button_press): Added support
        for wheel mice (buttons 4 and 5).
This commit is contained in:
Stefan Jeske 1999-11-21 15:55:45 +00:00 committed by Stefan Jeske
parent 7b4d53a529
commit 09240118e1
8 changed files with 50 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sun Nov 21 16:44:35 1999 Stefan Jeske <stefan@gtk.org>
* gtk/gtkspinbutton.c (gtk_spin_button_button_press): Added support
for wheel mice (buttons 4 and 5).
1999-11-18 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_gc_predraw): Also for truecolor

View File

@ -1,3 +1,8 @@
Sun Nov 21 16:44:35 1999 Stefan Jeske <stefan@gtk.org>
* gtk/gtkspinbutton.c (gtk_spin_button_button_press): Added support
for wheel mice (buttons 4 and 5).
1999-11-18 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_gc_predraw): Also for truecolor

View File

@ -1,3 +1,8 @@
Sun Nov 21 16:44:35 1999 Stefan Jeske <stefan@gtk.org>
* gtk/gtkspinbutton.c (gtk_spin_button_button_press): Added support
for wheel mice (buttons 4 and 5).
1999-11-18 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_gc_predraw): Also for truecolor

View File

@ -1,3 +1,8 @@
Sun Nov 21 16:44:35 1999 Stefan Jeske <stefan@gtk.org>
* gtk/gtkspinbutton.c (gtk_spin_button_button_press): Added support
for wheel mice (buttons 4 and 5).
1999-11-18 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_gc_predraw): Also for truecolor

View File

@ -1,3 +1,8 @@
Sun Nov 21 16:44:35 1999 Stefan Jeske <stefan@gtk.org>
* gtk/gtkspinbutton.c (gtk_spin_button_button_press): Added support
for wheel mice (buttons 4 and 5).
1999-11-18 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_gc_predraw): Also for truecolor

View File

@ -1,3 +1,8 @@
Sun Nov 21 16:44:35 1999 Stefan Jeske <stefan@gtk.org>
* gtk/gtkspinbutton.c (gtk_spin_button_button_press): Added support
for wheel mice (buttons 4 and 5).
1999-11-18 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_gc_predraw): Also for truecolor

View File

@ -1,3 +1,8 @@
Sun Nov 21 16:44:35 1999 Stefan Jeske <stefan@gtk.org>
* gtk/gtkspinbutton.c (gtk_spin_button_button_press): Added support
for wheel mice (buttons 4 and 5).
1999-11-18 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkgc-win32.c (gdk_gc_predraw): Also for truecolor

View File

@ -45,6 +45,8 @@
#define MAX_TEXT_LENGTH 256
#define MAX_TIMER_CALLS 5
#define EPSILON 1e-5
#define WHEEL_UP_BUTTON 4
#define WHEEL_DOWN_BUTTON 5
enum {
ARG_0,
@ -763,7 +765,19 @@ gtk_spin_button_button_press (GtkWidget *widget,
if (!spin->button)
{
if (event->window == spin->panel)
if (event->button == WHEEL_UP_BUTTON)
{
if (!GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);
gtk_spin_button_real_spin (spin, spin->adjustment->step_increment);
}
else if (event->button == WHEEL_DOWN_BUTTON)
{
if (!GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);
gtk_spin_button_real_spin (spin, -spin->adjustment->step_increment);
}
else if (event->window == spin->panel)
{
if (!GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);