/* Copyright (C) 1998-2002 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see . */ #include #include _DEFS(gtkmm,gtk) _PINCLUDE(gtkmm/private/entry_p.h) namespace Gtk { _CC_INCLUDE(gtk/gtk.h) _WRAP_ENUM(SpinButtonUpdatePolicy, GtkSpinButtonUpdatePolicy, decl_prefix GTKMM_API) _WRAP_ENUM(SpinType, GtkSpinType, decl_prefix GTKMM_API) /** @ingroup gtkmmEnums */ enum { INPUT_ERROR = -1 }; class GTKMM_API Adjustment; /** numeric Entry with up/down buttons * Slightly misnamed, this should be called a SpinEntry. * * The SpinButton widget looks like this: * @image html spinbutton1.png * * @ingroup Widgets */ class GTKMM_API SpinButton : public Entry { _CLASS_GTKOBJECT(SpinButton,GtkSpinButton,GTK_SPIN_BUTTON,Gtk::Entry,GtkEntry,,,GTKMM_API) public: //TODO: This constructor should be implicit //: create instance // adjustment: see Gtk::Adjustment // climb_rate: // digits: number of decimal digits (has to be < 6) SpinButton(double climb_rate = 0.0, guint digits = 0); _WRAP_CTOR(SpinButton(const Glib::RefPtr& adjustment, double climb_rate = 0.0, guint digits = 0), gtk_spin_button_new) _WRAP_METHOD(void configure(const Glib::RefPtr& adjustment, double climb_rate, guint digits), gtk_spin_button_configure) _WRAP_METHOD(void set_adjustment(const Glib::RefPtr& adjustment), gtk_spin_button_set_adjustment) void unset_adjustment(); _WRAP_METHOD(Glib::RefPtr get_adjustment(), gtk_spin_button_get_adjustment, refreturn) _WRAP_METHOD(Glib::RefPtr get_adjustment() const, gtk_spin_button_get_adjustment, refreturn, constversion) _WRAP_METHOD(void set_digits(guint digits), gtk_spin_button_set_digits) _WRAP_METHOD(guint get_digits() const, gtk_spin_button_get_digits) _WRAP_METHOD(void set_increments(double step, double page), gtk_spin_button_set_increments) _WRAP_METHOD(void get_increments(double& step, double& page) const, gtk_spin_button_get_increments) _WRAP_METHOD(void set_range(double min, double max), gtk_spin_button_set_range) _WRAP_METHOD(void get_range(double& min, double& max) const, gtk_spin_button_get_range) _WRAP_METHOD(double get_value() const, gtk_spin_button_get_value) _WRAP_METHOD(int get_value_as_int() const, gtk_spin_button_get_value_as_int) _WRAP_METHOD(void set_value(double value), gtk_spin_button_set_value) _WRAP_METHOD(void set_update_policy(SpinButtonUpdatePolicy policy), gtk_spin_button_set_update_policy) _WRAP_METHOD(SpinButtonUpdatePolicy get_update_policy() const, gtk_spin_button_get_update_policy) _WRAP_METHOD(void set_numeric(bool numeric = true), gtk_spin_button_set_numeric) _WRAP_METHOD(bool get_numeric() const, gtk_spin_button_get_numeric) _WRAP_METHOD(void spin(SpinType direction, double increment), gtk_spin_button_spin) _WRAP_METHOD(void set_wrap(bool wrap = true), gtk_spin_button_set_wrap) _WRAP_METHOD(bool get_wrap() const, gtk_spin_button_get_wrap) _WRAP_METHOD(void set_snap_to_ticks(bool snap_to_ticks = true), gtk_spin_button_set_snap_to_ticks) _WRAP_METHOD(bool get_snap_to_ticks() const, gtk_spin_button_get_snap_to_ticks) _WRAP_METHOD(void update(), gtk_spin_button_update) _WRAP_SIGNAL(int input(double* new_value), "input") _WRAP_SIGNAL(bool output(), "output") _WRAP_SIGNAL(void wrapped(), "wrapped") _WRAP_SIGNAL(void value_changed(), "value_changed") //Keybinding signals: _IGNORE_SIGNAL("change_value") _WRAP_PROPERTY("adjustment", Glib::RefPtr) _WRAP_PROPERTY("climb-rate", double) _WRAP_PROPERTY("digits", guint) _WRAP_PROPERTY("snap-to-ticks", bool) _WRAP_PROPERTY("numeric", bool) _WRAP_PROPERTY("wrap", bool) _WRAP_PROPERTY("update-policy", SpinButtonUpdatePolicy) _WRAP_PROPERTY("value", double) }; } // namespace Gtk