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