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