1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * GtkSpinButton widget for GTK+
5 * Copyright (C) 1998 Lars Hamann and Stefan Jeske
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __GTK_SPIN_BUTTON_H__
23 #define __GTK_SPIN_BUTTON_H__
27 #include <gtk/gtkentry.h>
28 #include <gtk/gtkadjustment.h>
33 #endif /* __cplusplus */
36 #define GTK_SPIN_BUTTON(obj) GTK_CHECK_CAST (obj, gtk_spin_button_get_type (), GtkSpinButton)
37 #define GTK_SPIN_BUTTON_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_spin_button_get_type (), GtkSpinButtonClass)
38 #define GTK_IS_SPIN_BUTTON(obj) GTK_CHECK_TYPE (obj, gtk_spin_button_get_type ())
43 GTK_UPDATE_ALWAYS = 1 << 0,
44 GTK_UPDATE_IF_VALID = 1 << 1,
45 GTK_UPDATE_SNAP_TO_TICKS = 1 << 2
46 } GtkSpinButtonUpdatePolicy;
49 typedef struct _GtkSpinButton GtkSpinButton;
50 typedef struct _GtkSpinButtonClass GtkSpinButtonClass;
57 GtkAdjustment *adjustment;
69 guint click_child : 2;
72 guint timer_calls : 3;
78 struct _GtkSpinButtonClass
80 GtkEntryClass parent_class;
83 guint gtk_spin_button_get_type (void);
85 void gtk_spin_button_construct (GtkSpinButton *spin_button,
86 GtkAdjustment *adjustment,
90 GtkWidget* gtk_spin_button_new (GtkAdjustment *adjustment,
94 void gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
95 GtkAdjustment *adjustment);
97 GtkAdjustment* gtk_spin_button_get_adjustment (GtkSpinButton *spin_button);
99 void gtk_spin_button_set_digits (GtkSpinButton *spin_button,
102 gfloat gtk_spin_button_get_value_as_float (GtkSpinButton *spin_button);
104 gint gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button);
106 void gtk_spin_button_set_value (GtkSpinButton *spin_button,
109 void gtk_spin_button_set_update_policy (GtkSpinButton *spin_button,
110 GtkSpinButtonUpdatePolicy policy);
112 void gtk_spin_button_set_numeric (GtkSpinButton *spin_button,
115 void gtk_spin_button_spin (GtkSpinButton *spin_button,
119 void gtk_spin_button_set_wrap (GtkSpinButton *spin_button,
127 #endif /* __cplusplus */
130 #endif /* __GTK_SPIN_BUTTON_H__ */