1 /* Copyright (C) 2006 The gtkmm Development Team
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Library General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public
14 * License along with this library; if not, write to the Free
15 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 #include <gtkmm/cellrenderertext.h>
19 //#include <gtkmm/treemodel.h>
22 _PINCLUDE(gtkmm/private/cellrenderertext_p.h)
27 /** Renders a spin button in a cell.
29 * Gtk::CellRendererSpin renders text in a cell like Gtk::CellRendererText,
30 * from which it is derived. But while Gtk::CellRendererText offers a simple
31 * entry to edit the text, Gtk::CellRendererSpin offers a Gtk::SpinButton widget.
32 * Of course, that means that the text must be parseable as a floating point
35 * The range of the spinbutton is taken from the adjustment property of the
36 * cell renderer, which can be set explicitly or mapped to a column in
37 * the tree model, like all properties of cell renders. Gtk::CellRendererSpin
38 * also has properties for the climb rate and the number of digits to display.
39 * Other Gtk::SpinButton properties can be set in a handler for the start-editing
45 class CellRendererSpin : public CellRendererText
47 _CLASS_GTKOBJECT(CellRendererSpin, GtkCellRendererSpin, GTK_CELL_RENDERER_SPIN, Gtk::CellRendererText, GtkCellRendererText)
52 _WRAP_PROPERTY("adjustment", Gtk::Adjustment*)
53 _WRAP_PROPERTY("climb_rate", double)
54 _WRAP_PROPERTY("digits", guint)
56 #ifdef GLIBMM_PROPERTIES_ENABLED
57 virtual Glib::PropertyProxy_Base _property_renderable(); //override
58 #endif //GLIBMM_PROPERTIES_ENABLED