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