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 gtkc.gtk;
32 public  import gtkc.gtktypes;
33 
34 
35 /**
36  * #GtkCellRendererSpin renders text in a cell like #GtkCellRendererText from
37  * which it is derived. But while #GtkCellRendererText offers a simple entry to
38  * edit the text, #GtkCellRendererSpin offers a #GtkSpinButton widget. Of course,
39  * that means that the text has to be parseable as a floating point number.
40  * 
41  * The range of the spinbutton is taken from the adjustment property of the
42  * cell renderer, which can be set explicitly or mapped to a column in the
43  * tree model, like all properties of cell renders. #GtkCellRendererSpin
44  * also has properties for the #GtkCellRendererSpin:climb-rate and the number
45  * of #GtkCellRendererSpin:digits to display. Other #GtkSpinButton properties
46  * can be set in a handler for the #GtkCellRenderer::editing-started signal.
47  * 
48  * The #GtkCellRendererSpin cell renderer was added in GTK+ 2.10.
49  */
50 public class CellRendererSpin : CellRendererText
51 {
52 	/** the main Gtk struct */
53 	protected GtkCellRendererSpin* gtkCellRendererSpin;
54 
55 	/** Get the main Gtk struct */
56 	public GtkCellRendererSpin* getCellRendererSpinStruct()
57 	{
58 		return gtkCellRendererSpin;
59 	}
60 
61 	/** the main Gtk struct as a void* */
62 	protected override void* getStruct()
63 	{
64 		return cast(void*)gtkCellRendererSpin;
65 	}
66 
67 	protected override void setStruct(GObject* obj)
68 	{
69 		gtkCellRendererSpin = cast(GtkCellRendererSpin*)obj;
70 		super.setStruct(obj);
71 	}
72 
73 	/**
74 	 * Sets our main struct and passes it to the parent class.
75 	 */
76 	public this (GtkCellRendererSpin* gtkCellRendererSpin, bool ownedRef = false)
77 	{
78 		this.gtkCellRendererSpin = gtkCellRendererSpin;
79 		super(cast(GtkCellRendererText*)gtkCellRendererSpin, ownedRef);
80 	}
81 
82 	/**
83 	 */
84 
85 	public static GType getType()
86 	{
87 		return gtk_cell_renderer_spin_get_type();
88 	}
89 
90 	/**
91 	 * Creates a new #GtkCellRendererSpin.
92 	 *
93 	 * Return: a new #GtkCellRendererSpin
94 	 *
95 	 * Since: 2.10
96 	 *
97 	 * Throws: ConstructionException GTK+ fails to create the object.
98 	 */
99 	public this()
100 	{
101 		auto p = gtk_cell_renderer_spin_new();
102 		
103 		if(p is null)
104 		{
105 			throw new ConstructionException("null returned by new");
106 		}
107 		
108 		this(cast(GtkCellRendererSpin*) p);
109 	}
110 }