alternative to assert
[gtkD.git] / gtkD / src / gtk / HScale.d
blob9c7ff5567ae64b5ff50d906715ba10c6f2a8b74c
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkHScale.html
26 * outPack = gtk
27 * outFile = HScale
28 * strct = GtkHScale
29 * realStrct=
30 * ctorStrct=
31 * clss = HScale
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_hscale_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - gtk.Adjustment
46 * structWrap:
47 * - GtkAdjustment* -> Adjustment
48 * module aliases:
49 * local aliases:
52 module gtk.HScale;
54 version(noAssert)
56 version(Tango)
58 import tango.io.Stdout; // use the tango loging?
62 private import gtkc.gtktypes;
64 private import gtkc.gtk;
67 private import gtk.Adjustment;
72 /**
73 * Description
74 * The GtkHScale widget is used to allow the user to select a value using
75 * a horizontal slider. To create one, use gtk_hscale_new_with_range().
76 * The position to show the current value, and the number of decimal places
77 * shown can be set using the parent GtkScale class's functions.
79 private import gtk.Scale;
80 public class HScale : Scale
83 /** the main Gtk struct */
84 protected GtkHScale* gtkHScale;
87 public GtkHScale* getHScaleStruct()
89 return gtkHScale;
93 /** the main Gtk struct as a void* */
94 protected void* getStruct()
96 return cast(void*)gtkHScale;
99 /**
100 * Sets our main struct and passes it to the parent class
102 public this (GtkHScale* gtkHScale)
104 version(noAssert)
106 if ( gtkHScale is null )
108 int zero = 0;
109 version(Tango)
111 Stdout("struct gtkHScale is null on constructor").newline;
113 else
115 printf("struct gtkHScale is null on constructor");
117 zero = zero / zero;
120 else
122 assert(gtkHScale !is null, "struct gtkHScale is null on constructor");
124 super(cast(GtkScale*)gtkHScale);
125 this.gtkHScale = gtkHScale;
133 * Creates a new GtkHScale.
134 * adjustment:
135 * the GtkAdjustment which sets the range of the scale.
136 * Returns:
137 * a new GtkHScale.
139 public this (Adjustment adjustment)
141 // GtkWidget* gtk_hscale_new (GtkAdjustment *adjustment);
142 this(cast(GtkHScale*)gtk_hscale_new((adjustment is null) ? null : adjustment.getAdjustmentStruct()) );
146 * Creates a new horizontal scale widget that lets the user input a
147 * number between min and max (including min and max) with the
148 * increment step. step must be nonzero; it's the distance the
149 * slider moves when using the arrow keys to adjust the scale value.
150 * Note that the way in which the precision is derived works best if step
151 * is a power of ten. If the resulting precision is not suitable for your
152 * needs, use gtk_scale_set_digits() to correct it.
153 * min:
154 * minimum value
155 * max:
156 * maximum value
157 * step:
158 * step increment (tick size) used with keyboard shortcuts
159 * Returns:
160 * a new GtkHScale
162 public this (double min, double max, double step)
164 // GtkWidget* gtk_hscale_new_with_range (gdouble min, gdouble max, gdouble step);
165 this(cast(GtkHScale*)gtk_hscale_new_with_range(min, max, step) );