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  = GtkScrollbar.html
27  * outPack = gtk
28  * outFile = Scrollbar
29  * strct   = GtkScrollbar
30  * realStrct=
31  * ctorStrct=
32  * clss    = Scrollbar
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_scrollbar_
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.Scrollbar;
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.Range;
66 
67 /**
68  * The GtkScrollbar widget is a horizontal or vertical scrollbar,
69  * depending on the value of the "orientation" property.
70  *
71  * The position of the thumb in a scrollbar is controlled by the scroll
72  * adjustments. See GtkAdjustment for the fields in an adjustment - for
73  * GtkScrollbar, the "value" field represents the position
74  * of the scrollbar, which must be between the "lower" field
75  * and "upper" - "page-size". The
76  * "page-size" field represents the size of the visible
77  * scrollable area. The "step-increment" and
78  * "page-increment" fields are properties when the user asks to
79  * step down (using the small stepper arrows) or page down (using for
80  * example the PageDown key).
81  */
82 public class Scrollbar : Range
83 {
84 	
85 	/** the main Gtk struct */
86 	protected GtkScrollbar* gtkScrollbar;
87 	
88 	
89 	/** Get the main Gtk struct */
90 	public GtkScrollbar* getScrollbarStruct()
91 	{
92 		return gtkScrollbar;
93 	}
94 	
95 	
96 	/** the main Gtk struct as a void* */
97 	protected override void* getStruct()
98 	{
99 		return cast(void*)gtkScrollbar;
100 	}
101 	
102 	/**
103 	 * Sets our main struct and passes it to the parent class
104 	 */
105 	public this (GtkScrollbar* gtkScrollbar)
106 	{
107 		super(cast(GtkRange*)gtkScrollbar);
108 		this.gtkScrollbar = gtkScrollbar;
109 	}
110 	
111 	protected override void setStruct(GObject* obj)
112 	{
113 		super.setStruct(obj);
114 		gtkScrollbar = cast(GtkScrollbar*)obj;
115 	}
116 	
117 	/**
118 	 */
119 	
120 	/**
121 	 * Creates a new scrollbar with the given orientation.
122 	 * Params:
123 	 * orientation = the scrollbar's orientation.
124 	 * adjustment = the GtkAdjustment to use, or NULL to create a new adjustment. [allow-none]
125 	 * Throws: ConstructionException GTK+ fails to create the object.
126 	 */
127 	public this (GtkOrientation orientation, Adjustment adjustment)
128 	{
129 		// GtkWidget * gtk_scrollbar_new (GtkOrientation orientation,  GtkAdjustment *adjustment);
130 		auto p = gtk_scrollbar_new(orientation, (adjustment is null) ? null : adjustment.getAdjustmentStruct());
131 		if(p is null)
132 		{
133 			throw new ConstructionException("null returned by gtk_scrollbar_new(orientation, (adjustment is null) ? null : adjustment.getAdjustmentStruct())");
134 		}
135 		this(cast(GtkScrollbar*) p);
136 	}
137 }