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 * Conversion parameters: 26 * inFile = GtkCellRendererSpin.html 27 * outPack = gtk 28 * outFile = CellRendererSpin 29 * strct = GtkCellRendererSpin 30 * realStrct= 31 * ctorStrct=GtkCellRenderer 32 * clss = CellRendererSpin 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_cell_renderer_spin_ 41 * - gtk_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - gtk.CellRenderer 48 * structWrap: 49 * - GtkCellRenderer* -> CellRenderer 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gtk.CellRendererSpin; 56 57 public import gtkc.gtktypes; 58 59 private import gtkc.gtk; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 64 private import gtk.CellRenderer; 65 66 67 68 private import gtk.CellRendererText; 69 70 /** 71 * Description 72 * GtkCellRendererSpin renders text in a cell like GtkCellRendererText from 73 * which it is derived. But while GtkCellRendererText offers a simple entry to 74 * edit the text, GtkCellRendererSpin offers a GtkSpinButton widget. Of course, 75 * that means that the text has to be parseable as a floating point number. 76 * The range of the spinbutton is taken from the adjustment property of the 77 * cell renderer, which can be set explicitly or mapped to a column in the 78 * tree model, like all properties of cell renders. GtkCellRendererSpin 79 * also has properties for the climb rate and the number of digits to 80 * display. Other GtkSpinButton properties can be set in a handler for the 81 * start-editing signal. 82 * The GtkCellRendererSpin cell renderer was added in GTK+ 2.10. 83 */ 84 public class CellRendererSpin : CellRendererText 85 { 86 87 /** the main Gtk struct */ 88 protected GtkCellRendererSpin* gtkCellRendererSpin; 89 90 91 public GtkCellRendererSpin* getCellRendererSpinStruct() 92 { 93 return gtkCellRendererSpin; 94 } 95 96 97 /** the main Gtk struct as a void* */ 98 protected override void* getStruct() 99 { 100 return cast(void*)gtkCellRendererSpin; 101 } 102 103 /** 104 * Sets our main struct and passes it to the parent class 105 */ 106 public this (GtkCellRendererSpin* gtkCellRendererSpin) 107 { 108 super(cast(GtkCellRendererText*)gtkCellRendererSpin); 109 this.gtkCellRendererSpin = gtkCellRendererSpin; 110 } 111 112 protected override void setStruct(GObject* obj) 113 { 114 super.setStruct(obj); 115 gtkCellRendererSpin = cast(GtkCellRendererSpin*)obj; 116 } 117 118 /** 119 */ 120 121 /** 122 * Creates a new GtkCellRendererSpin. 123 * Since 2.10 124 * Throws: ConstructionException GTK+ fails to create the object. 125 */ 126 public this () 127 { 128 // GtkCellRenderer * gtk_cell_renderer_spin_new (void); 129 auto p = gtk_cell_renderer_spin_new(); 130 if(p is null) 131 { 132 throw new ConstructionException("null returned by gtk_cell_renderer_spin_new()"); 133 } 134 this(cast(GtkCellRendererSpin*) p); 135 } 136 }