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.HScrollbar; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import gtk.Adjustment; 30 private import gtk.Scrollbar; 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 #GtkHScrollbar widget is a widget arranged horizontally creating a 39 * scrollbar. See #GtkScrollbar for details on 40 * scrollbars. #GtkAdjustment pointers may be added to handle the 41 * adjustment of the scrollbar or it may be left %NULL in which case one 42 * will be created for you. See #GtkScrollbar for a description of what the 43 * fields in an adjustment represent for a scrollbar. 44 * 45 * GtkHScrollbar has been deprecated, use #GtkScrollbar instead. 46 */ 47 public class HScrollbar : Scrollbar 48 { 49 /** the main Gtk struct */ 50 protected GtkHScrollbar* gtkHScrollbar; 51 52 /** Get the main Gtk struct */ 53 public GtkHScrollbar* getHScrollbarStruct(bool transferOwnership = false) 54 { 55 if (transferOwnership) 56 ownedRef = false; 57 return gtkHScrollbar; 58 } 59 60 /** the main Gtk struct as a void* */ 61 protected override void* getStruct() 62 { 63 return cast(void*)gtkHScrollbar; 64 } 65 66 protected override void setStruct(GObject* obj) 67 { 68 gtkHScrollbar = cast(GtkHScrollbar*)obj; 69 super.setStruct(obj); 70 } 71 72 /** 73 * Sets our main struct and passes it to the parent class. 74 */ 75 public this (GtkHScrollbar* gtkHScrollbar, bool ownedRef = false) 76 { 77 this.gtkHScrollbar = gtkHScrollbar; 78 super(cast(GtkScrollbar*)gtkHScrollbar, ownedRef); 79 } 80 81 82 /** */ 83 public static GType getType() 84 { 85 return gtk_hscrollbar_get_type(); 86 } 87 88 /** 89 * Creates a new horizontal scrollbar. 90 * 91 * Deprecated: Use gtk_scrollbar_new() with %GTK_ORIENTATION_HORIZONTAL instead 92 * 93 * Params: 94 * adjustment = the #GtkAdjustment to use, or %NULL to create a new adjustment 95 * 96 * Returns: the new #GtkHScrollbar 97 * 98 * Throws: ConstructionException GTK+ fails to create the object. 99 */ 100 public this(Adjustment adjustment) 101 { 102 auto p = gtk_hscrollbar_new((adjustment is null) ? null : adjustment.getAdjustmentStruct()); 103 104 if(p is null) 105 { 106 throw new ConstructionException("null returned by new"); 107 } 108 109 this(cast(GtkHScrollbar*) p); 110 } 111 }