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