1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef __GTK_SPIN_BUTTON_H__
20 #define __GTK_SPIN_BUTTON_H__
24 #include <gtk/gtkentry.h>
25 #include <gtk/gtkadjustment.h>
30 #endif /* __cplusplus */
33 #define GTK_SPIN_BUTTON(obj) GTK_CHECK_CAST (obj, gtk_spin_button_get_type (), GtkSpinButton)
34 #define GTK_SPIN_BUTTON_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_spin_button_get_type (), GtkSpinButtonClass)
35 #define GTK_IS_SPIN_BUTTON(obj) GTK_CHECK_TYPE (obj, gtk_spin_button_get_type ())
40 GTK_UPDATE_ALWAYS = 1 << 0,
41 GTK_UPDATE_IF_VALID = 1 << 1,
42 GTK_UPDATE_SNAP_TO_TICKS = 1 << 2
43 } GtkSpinButtonUpdatePolicy;
46 typedef struct _GtkSpinButton GtkSpinButton;
47 typedef struct _GtkSpinButtonClass GtkSpinButtonClass;
54 GtkAdjustment *adjustment;
67 guint click_child : 2;
70 guint timer_calls : 3;
74 struct _GtkSpinButtonClass
76 GtkEntryClass parent_class;
80 gtk_spin_button_get_type (void);
83 gtk_spin_button_construct (GtkSpinButton *spin_button,
84 GtkAdjustment *adjustment,
89 gtk_spin_button_new (GtkAdjustment *adjustment,
94 gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
95 GtkAdjustment *adjustment);
98 gtk_spin_button_get_adjustment (GtkSpinButton *spin_button);
101 gtk_spin_button_set_digits (GtkSpinButton *spin_button,
105 gtk_spin_button_get_value_as_float (GtkSpinButton *spin_button);
108 gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button);
111 gtk_spin_button_set_value (GtkSpinButton *spin_button,
115 gtk_spin_button_set_update_policy (GtkSpinButton *spin_button,
116 GtkSpinButtonUpdatePolicy policy);
120 #endif /* __cplusplus */
123 #endif /* __GTK_SPIN_BUTTON_H__ */