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
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef __GTK_SPIN_BUTTON_H__
24 #define __GTK_SPIN_BUTTON_H__
28 #include <gtk/gtkentry.h>
29 #include <gtk/gtkadjustment.h>
34 #endif /* __cplusplus */
37 #define GTK_SPIN_BUTTON(obj) GTK_CHECK_CAST (obj, gtk_spin_button_get_type (), GtkSpinButton)
38 #define GTK_SPIN_BUTTON_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_spin_button_get_type (), GtkSpinButtonClass)
39 #define GTK_IS_SPIN_BUTTON(obj) GTK_CHECK_TYPE (obj, gtk_spin_button_get_type ())
44 GTK_UPDATE_ALWAYS = 1 << 0,
45 GTK_UPDATE_IF_VALID = 1 << 1,
46 GTK_UPDATE_SNAP_TO_TICKS = 1 << 2
47 } GtkSpinButtonUpdatePolicy;
50 typedef struct _GtkSpinButton GtkSpinButton;
51 typedef struct _GtkSpinButtonClass GtkSpinButtonClass;
58 GtkAdjustment *adjustment;
61 GtkShadowType shadow_type;
71 guint click_child : 2;
74 guint timer_calls : 3;
80 struct _GtkSpinButtonClass
82 GtkEntryClass parent_class;
85 guint gtk_spin_button_get_type (void);
87 void gtk_spin_button_construct (GtkSpinButton *spin_button,
88 GtkAdjustment *adjustment,
92 GtkWidget* gtk_spin_button_new (GtkAdjustment *adjustment,
96 void gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
97 GtkAdjustment *adjustment);
99 GtkAdjustment* gtk_spin_button_get_adjustment (GtkSpinButton *spin_button);
101 void gtk_spin_button_set_digits (GtkSpinButton *spin_button,
104 gfloat gtk_spin_button_get_value_as_float (GtkSpinButton *spin_button);
106 gint gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button);
108 void gtk_spin_button_set_value (GtkSpinButton *spin_button,
111 void gtk_spin_button_set_update_policy (GtkSpinButton *spin_button,
112 GtkSpinButtonUpdatePolicy policy);
114 void gtk_spin_button_set_numeric (GtkSpinButton *spin_button,
117 void gtk_spin_button_spin (GtkSpinButton *spin_button,
121 void gtk_spin_button_set_wrap (GtkSpinButton *spin_button,
124 void gtk_spin_button_set_shadow_type (GtkSpinButton *spin_button,
125 GtkShadowType shadow_type);
132 #endif /* __cplusplus */
135 #endif /* __GTK_SPIN_BUTTON_H__ */