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 	protected override void setStruct(GObject* obj)
71 	{
72 		gtkCellRendererSpin = cast(GtkCellRendererSpin*)obj;
73 		super.setStruct(obj);
74 	}
75 
76 	/**
77 	 * Sets our main struct and passes it to the parent class.
78 	 */
79 	public this (GtkCellRendererSpin* gtkCellRendererSpin, bool ownedRef = false)
80 	{
81 		this.gtkCellRendererSpin = gtkCellRendererSpin;
82 		super(cast(GtkCellRendererText*)gtkCellRendererSpin, ownedRef);
83 	}
84 
85 
86 	/** */
87 	public static GType getType()
88 	{
89 		return gtk_cell_renderer_spin_get_type();
90 	}
91 
92 	/**
93 	 * Creates a new #GtkCellRendererSpin.
94 	 *
95 	 * Returns: a new #GtkCellRendererSpin
96 	 *
97 	 * Since: 2.10
98 	 *
99 	 * Throws: ConstructionException GTK+ fails to create the object.
100 	 */
101 	public this()
102 	{
103 		auto p = gtk_cell_renderer_spin_new();
104 
105 		if(p is null)
106 		{
107 			throw new ConstructionException("null returned by new");
108 		}
109 
110 		this(cast(GtkCellRendererSpin*) p);
111 	}
112 }