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.VScale;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Adjustment;
30 private import gtk.Scale;
31 private import gtk.Widget;
32 private import gtkc.gtk;
33 public  import gtkc.gtktypes;
34 
35 
36 /**
37  * The #GtkVScale widget is used to allow the user to select a value using
38  * a vertical slider. To create one, use gtk_hscale_new_with_range().
39  * 
40  * The position to show the current value, and the number of decimal places
41  * shown can be set using the parent #GtkScale class’s functions.
42  * 
43  * GtkVScale has been deprecated, use #GtkScale instead.
44  */
45 public class VScale : Scale
46 {
47 	/** the main Gtk struct */
48 	protected GtkVScale* gtkVScale;
49 
50 	/** Get the main Gtk struct */
51 	public GtkVScale* getVScaleStruct(bool transferOwnership = false)
52 	{
53 		if (transferOwnership)
54 			ownedRef = false;
55 		return gtkVScale;
56 	}
57 
58 	/** the main Gtk struct as a void* */
59 	protected override void* getStruct()
60 	{
61 		return cast(void*)gtkVScale;
62 	}
63 
64 	protected override void setStruct(GObject* obj)
65 	{
66 		gtkVScale = cast(GtkVScale*)obj;
67 		super.setStruct(obj);
68 	}
69 
70 	/**
71 	 * Sets our main struct and passes it to the parent class.
72 	 */
73 	public this (GtkVScale* gtkVScale, bool ownedRef = false)
74 	{
75 		this.gtkVScale = gtkVScale;
76 		super(cast(GtkScale*)gtkVScale, ownedRef);
77 	}
78 
79 
80 	/** */
81 	public static GType getType()
82 	{
83 		return gtk_vscale_get_type();
84 	}
85 
86 	/**
87 	 * Creates a new #GtkVScale.
88 	 *
89 	 * Deprecated: Use gtk_scale_new() with %GTK_ORIENTATION_VERTICAL instead
90 	 *
91 	 * Params:
92 	 *     adjustment = the #GtkAdjustment which sets the range of the scale.
93 	 *
94 	 * Returns: a new #GtkVScale.
95 	 *
96 	 * Throws: ConstructionException GTK+ fails to create the object.
97 	 */
98 	public this(Adjustment adjustment)
99 	{
100 		auto p = gtk_vscale_new((adjustment is null) ? null : adjustment.getAdjustmentStruct());
101 		
102 		if(p is null)
103 		{
104 			throw new ConstructionException("null returned by new");
105 		}
106 		
107 		this(cast(GtkVScale*) p);
108 	}
109 
110 	/**
111 	 * Creates a new vertical scale widget that lets the user input a
112 	 * number between @min and @max (including @min and @max) with the
113 	 * increment @step.  @step must be nonzero; it’s the distance the
114 	 * slider moves when using the arrow keys to adjust the scale value.
115 	 *
116 	 * Note that the way in which the precision is derived works best if @step
117 	 * is a power of ten. If the resulting precision is not suitable for your
118 	 * needs, use gtk_scale_set_digits() to correct it.
119 	 *
120 	 * Deprecated: Use gtk_scale_new_with_range() with %GTK_ORIENTATION_VERTICAL instead
121 	 *
122 	 * Params:
123 	 *     min = minimum value
124 	 *     max = maximum value
125 	 *     step = step increment (tick size) used with keyboard shortcuts
126 	 *
127 	 * Returns: a new #GtkVScale
128 	 *
129 	 * Throws: ConstructionException GTK+ fails to create the object.
130 	 */
131 	public this(double min, double max, double step)
132 	{
133 		auto p = gtk_vscale_new_with_range(min, max, step);
134 		
135 		if(p is null)
136 		{
137 			throw new ConstructionException("null returned by new_with_range");
138 		}
139 		
140 		this(cast(GtkVScale*) p);
141 	}
142 }