1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.CellRendererSpin;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.CellRenderer;
30 private import gtk.CellRendererText;
31 private import gtk.c.functions;
32 public  import gtk.c.types;
33 public  import gtkc.gtktypes;
34 
35 
36 /**
37  * #GtkCellRendererSpin renders text in a cell like #GtkCellRendererText from
38  * which it is derived. But while #GtkCellRendererText offers a simple entry to
39  * edit the text, #GtkCellRendererSpin offers a #GtkSpinButton widget. Of course,
40  * that means that the text has to be parseable as a floating point number.
41  * 
42  * The range of the spinbutton is taken from the adjustment property of the
43  * cell renderer, which can be set explicitly or mapped to a column in the
44  * tree model, like all properties of cell renders. #GtkCellRendererSpin
45  * also has properties for the #GtkCellRendererSpin:climb-rate and the number
46  * of #GtkCellRendererSpin:digits to display. Other #GtkSpinButton properties
47  * can be set in a handler for the #GtkCellRenderer::editing-started signal.
48  * 
49  * The #GtkCellRendererSpin cell renderer was added in GTK+ 2.10.
50  */
51 public class CellRendererSpin : CellRendererText
52 {
53 	/** the main Gtk struct */
54 	protected GtkCellRendererSpin* gtkCellRendererSpin;
55 
56 	/** Get the main Gtk struct */
57 	public GtkCellRendererSpin* getCellRendererSpinStruct(bool transferOwnership = false)
58 	{
59 		if (transferOwnership)
60 			ownedRef = false;
61 		return gtkCellRendererSpin;
62 	}
63 
64 	/** the main Gtk struct as a void* */
65 	protected override void* getStruct()
66 	{
67 		return cast(void*)gtkCellRendererSpin;
68 	}
69 
70 	/**
71 	 * Sets our main struct and passes it to the parent class.
72 	 */
73 	public this (GtkCellRendererSpin* gtkCellRendererSpin, bool ownedRef = false)
74 	{
75 		this.gtkCellRendererSpin = gtkCellRendererSpin;
76 		super(cast(GtkCellRendererText*)gtkCellRendererSpin, ownedRef);
77 	}
78 
79 
80 	/** */
81 	public static GType getType()
82 	{
83 		return gtk_cell_renderer_spin_get_type();
84 	}
85 
86 	/**
87 	 * Creates a new #GtkCellRendererSpin.
88 	 *
89 	 * Returns: a new #GtkCellRendererSpin
90 	 *
91 	 * Since: 2.10
92 	 *
93 	 * Throws: ConstructionException GTK+ fails to create the object.
94 	 */
95 	public this()
96 	{
97 		auto p = gtk_cell_renderer_spin_new();
98 
99 		if(p is null)
100 		{
101 			throw new ConstructionException("null returned by new");
102 		}
103 
104 		this(cast(GtkCellRendererSpin*) p);
105 	}
106 }