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>
35 #endif /* __cplusplus */
38 #define GTK_TYPE_SPIN_BUTTON (gtk_spin_button_get_type ())
39 #define GTK_SPIN_BUTTON(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SPIN_BUTTON, GtkSpinButton))
40 #define GTK_SPIN_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SPIN_BUTTON, GtkSpinButtonClass))
41 #define GTK_IS_SPIN_BUTTON(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SPIN_BUTTON))
42 #define GTK_IS_SPIN_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SPIN_BUTTON))
49 } GtkSpinButtonUpdatePolicy;
53 GTK_SPIN_STEP_FORWARD,
54 GTK_SPIN_STEP_BACKWARD,
55 GTK_SPIN_PAGE_FORWARD,
56 GTK_SPIN_PAGE_BACKWARD,
63 typedef struct _GtkSpinButton GtkSpinButton;
64 typedef struct _GtkSpinButtonClass GtkSpinButtonClass;
71 GtkAdjustment *adjustment;
74 GtkShadowType shadow_type;
82 GtkSpinButtonUpdatePolicy update_policy;
85 guint click_child : 2;
88 guint timer_calls : 3;
92 guint snap_to_ticks : 1;
95 struct _GtkSpinButtonClass
97 GtkEntryClass parent_class;
101 GtkType gtk_spin_button_get_type (void);
103 void gtk_spin_button_configure (GtkSpinButton *spin_button,
104 GtkAdjustment *adjustment,
108 GtkWidget* gtk_spin_button_new (GtkAdjustment *adjustment,
112 void gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
113 GtkAdjustment *adjustment);
115 GtkAdjustment* gtk_spin_button_get_adjustment (GtkSpinButton *spin_button);
117 void gtk_spin_button_set_digits (GtkSpinButton *spin_button,
120 gfloat gtk_spin_button_get_value_as_float (GtkSpinButton *spin_button);
122 gint gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button);
124 void gtk_spin_button_set_value (GtkSpinButton *spin_button,
127 void gtk_spin_button_set_update_policy (GtkSpinButton *spin_button,
128 GtkSpinButtonUpdatePolicy policy);
130 void gtk_spin_button_set_numeric (GtkSpinButton *spin_button,
133 void gtk_spin_button_spin (GtkSpinButton *spin_button,
134 GtkSpinType direction,
137 void gtk_spin_button_set_wrap (GtkSpinButton *spin_button,
140 void gtk_spin_button_set_shadow_type (GtkSpinButton *spin_button,
141 GtkShadowType shadow_type);
143 void gtk_spin_button_set_snap_to_ticks (GtkSpinButton *spin_button,
144 gboolean snap_to_ticks);
146 /* deprecated, defined for backwards compatibility */
147 #define gtk_spin_button_construct gtk_spin_button_configure
152 #endif /* __cplusplus */
155 #endif /* __GTK_SPIN_BUTTON_H__ */