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 = GtkHScale.html 27 * outPack = gtk 28 * outFile = HScale 29 * strct = GtkHScale 30 * realStrct= 31 * ctorStrct= 32 * clss = HScale 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_hscale_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gtk.Adjustment 47 * structWrap: 48 * - GtkAdjustment* -> Adjustment 49 * module aliases: 50 * local aliases: 51 * overrides: 52 */ 53 54 module gtk.HScale; 55 56 public import gtkc.gtktypes; 57 58 private import gtkc.gtk; 59 private import glib.ConstructionException; 60 private import gobject.ObjectG; 61 62 private import gtk.Adjustment; 63 64 65 private import gtk.Scale; 66 67 /** 68 * The GtkHScale widget is used to allow the user to select a value using 69 * a horizontal slider. To create one, use gtk_hscale_new_with_range(). 70 * 71 * The position to show the current value, and the number of decimal places 72 * shown can be set using the parent GtkScale class's functions. 73 * 74 * GtkHScale has been deprecated, use GtkScale instead. 75 */ 76 public class HScale : Scale 77 { 78 79 /** the main Gtk struct */ 80 protected GtkHScale* gtkHScale; 81 82 83 /** Get the main Gtk struct */ 84 public GtkHScale* getHScaleStruct() 85 { 86 return gtkHScale; 87 } 88 89 90 /** the main Gtk struct as a void* */ 91 protected override void* getStruct() 92 { 93 return cast(void*)gtkHScale; 94 } 95 96 /** 97 * Sets our main struct and passes it to the parent class 98 */ 99 public this (GtkHScale* gtkHScale) 100 { 101 super(cast(GtkScale*)gtkHScale); 102 this.gtkHScale = gtkHScale; 103 } 104 105 protected override void setStruct(GObject* obj) 106 { 107 super.setStruct(obj); 108 gtkHScale = cast(GtkHScale*)obj; 109 } 110 111 /** 112 */ 113 114 /** 115 * Warning 116 * gtk_hscale_new has been deprecated since version 3.2 and should not be used in newly-written code. Use gtk_scale_new() with GTK_ORIENTATION_HORIZONTAL instead 117 * Creates a new GtkHScale. 118 * Params: 119 * adjustment = the GtkAdjustment which sets the range of the scale. 120 * Throws: ConstructionException GTK+ fails to create the object. 121 */ 122 public this (Adjustment adjustment) 123 { 124 // GtkWidget * gtk_hscale_new (GtkAdjustment *adjustment); 125 auto p = gtk_hscale_new((adjustment is null) ? null : adjustment.getAdjustmentStruct()); 126 if(p is null) 127 { 128 throw new ConstructionException("null returned by gtk_hscale_new((adjustment is null) ? null : adjustment.getAdjustmentStruct())"); 129 } 130 this(cast(GtkHScale*) p); 131 } 132 133 /** 134 * Warning 135 * gtk_hscale_new_with_range has been deprecated since version 3.2 and should not be used in newly-written code. Use gtk_scale_new_with_range() with GTK_ORIENTATION_HORIZONTAL instead 136 * Creates a new horizontal scale widget that lets the user input a 137 * number between min and max (including min and max) with the 138 * increment step. step must be nonzero; it's the distance the 139 * slider moves when using the arrow keys to adjust the scale value. 140 * Note that the way in which the precision is derived works best if step 141 * is a power of ten. If the resulting precision is not suitable for your 142 * needs, use gtk_scale_set_digits() to correct it. 143 * Params: 144 * min = minimum value 145 * max = maximum value 146 * step = step increment (tick size) used with keyboard shortcuts 147 * Throws: ConstructionException GTK+ fails to create the object. 148 */ 149 public this (double min, double max, double step) 150 { 151 // GtkWidget * gtk_hscale_new_with_range (gdouble min, gdouble max, gdouble step); 152 auto p = gtk_hscale_new_with_range(min, max, step); 153 if(p is null) 154 { 155 throw new ConstructionException("null returned by gtk_hscale_new_with_range(min, max, step)"); 156 } 157 this(cast(GtkHScale*) p); 158 } 159 }