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 = GtkHButtonBox.html 27 * outPack = gtk 28 * outFile = HButtonBox 29 * strct = GtkHButtonBox 30 * realStrct= 31 * ctorStrct= 32 * clss = HButtonBox 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_hbutton_box_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * structWrap: 47 * module aliases: 48 * local aliases: 49 * overrides: 50 */ 51 52 module gtk.HButtonBox; 53 54 public import gtkc.gtktypes; 55 56 private import gtkc.gtk; 57 private import glib.ConstructionException; 58 private import gobject.ObjectG; 59 60 61 62 private import gtk.ButtonBox; 63 64 /** 65 * A button box should be used to provide a consistent layout of buttons 66 * throughout your application. The layout/spacing can be altered by the 67 * programmer, or if desired, by the user to alter the 'feel' of a 68 * program to a small degree. 69 * 70 * A GtkHButtonBox is created with gtk_hbutton_box_new(). Buttons are 71 * packed into a button box the same way widgets are added to any other 72 * container, using gtk_container_add(). You can also use 73 * gtk_box_pack_start() or gtk_box_pack_end(), but for button boxes both 74 * these functions work just like gtk_container_add(), ie., they pack the 75 * button in a way that depends on the current layout style and on 76 * whether the button has had gtk_button_box_set_child_secondary() called 77 * on it. 78 * 79 * The spacing between buttons can be set with gtk_box_set_spacing(). The 80 * arrangement and layout of the buttons can be changed with 81 * gtk_button_box_set_layout(). 82 * 83 * GtkHButtonBox has been deprecated, use GtkButtonBox instead. 84 */ 85 public class HButtonBox : ButtonBox 86 { 87 88 /** the main Gtk struct */ 89 protected GtkHButtonBox* gtkHButtonBox; 90 91 92 /** Get the main Gtk struct */ 93 public GtkHButtonBox* getHButtonBoxStruct() 94 { 95 return gtkHButtonBox; 96 } 97 98 99 /** the main Gtk struct as a void* */ 100 protected override void* getStruct() 101 { 102 return cast(void*)gtkHButtonBox; 103 } 104 105 /** 106 * Sets our main struct and passes it to the parent class 107 */ 108 public this (GtkHButtonBox* gtkHButtonBox) 109 { 110 super(cast(GtkButtonBox*)gtkHButtonBox); 111 this.gtkHButtonBox = gtkHButtonBox; 112 } 113 114 protected override void setStruct(GObject* obj) 115 { 116 super.setStruct(obj); 117 gtkHButtonBox = cast(GtkHButtonBox*)obj; 118 } 119 120 /** 121 * Creates a new HButtonBox and sets comon parameters 122 */ 123 static HButtonBox createActionBox() 124 { 125 HButtonBox bBox = new HButtonBox(); 126 bBox.setLayout(ButtonBoxStyle.END); 127 bBox.setBorderWidth(5); 128 bBox.setSpacing(7); 129 return bBox; 130 } 131 132 /** 133 */ 134 135 /** 136 * Warning 137 * gtk_hbutton_box_new has been deprecated since version 3.2 and should not be used in newly-written code. Use gtk_button_box_new() with GTK_ORIENTATION_HORIZONTAL instead 138 * Creates a new horizontal button box. 139 * Throws: ConstructionException GTK+ fails to create the object. 140 */ 141 public this () 142 { 143 // GtkWidget * gtk_hbutton_box_new (void); 144 auto p = gtk_hbutton_box_new(); 145 if(p is null) 146 { 147 throw new ConstructionException("null returned by gtk_hbutton_box_new()"); 148 } 149 this(cast(GtkHButtonBox*) p); 150 } 151 }