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 63 64 private import gtk.ButtonBox; 65 66 /** 67 * A button box should be used to provide a consistent layout of buttons 68 * throughout your application. The layout/spacing can be altered by the 69 * programmer, or if desired, by the user to alter the 'feel' of a 70 * program to a small degree. 71 * 72 * A GtkHButtonBox is created with gtk_hbutton_box_new(). Buttons are 73 * packed into a button box the same way widgets are added to any other 74 * container, using gtk_container_add(). You can also use 75 * gtk_box_pack_start() or gtk_box_pack_end(), but for button boxes both 76 * these functions work just like gtk_container_add(), ie., they pack the 77 * button in a way that depends on the current layout style and on 78 * whether the button has had gtk_button_box_set_child_secondary() called 79 * on it. 80 * 81 * The spacing between buttons can be set with gtk_box_set_spacing(). The 82 * arrangement and layout of the buttons can be changed with 83 * gtk_button_box_set_layout(). 84 * 85 * GtkHButtonBox has been deprecated, use GtkButtonBox instead. 86 */ 87 public class HButtonBox : ButtonBox 88 { 89 90 /** the main Gtk struct */ 91 protected GtkHButtonBox* gtkHButtonBox; 92 93 94 public GtkHButtonBox* getHButtonBoxStruct() 95 { 96 return gtkHButtonBox; 97 } 98 99 100 /** the main Gtk struct as a void* */ 101 protected override void* getStruct() 102 { 103 return cast(void*)gtkHButtonBox; 104 } 105 106 /** 107 * Sets our main struct and passes it to the parent class 108 */ 109 public this (GtkHButtonBox* gtkHButtonBox) 110 { 111 super(cast(GtkButtonBox*)gtkHButtonBox); 112 this.gtkHButtonBox = gtkHButtonBox; 113 } 114 115 protected override void setStruct(GObject* obj) 116 { 117 super.setStruct(obj); 118 gtkHButtonBox = cast(GtkHButtonBox*)obj; 119 } 120 121 /** 122 * Creates a new HButtonBox and sets comon parameters 123 */ 124 static HButtonBox createActionBox() 125 { 126 HButtonBox bBox = new HButtonBox(); 127 bBox.setLayout(ButtonBoxStyle.END); 128 bBox.setBorderWidth(5); 129 bBox.setSpacing(7); 130 return bBox; 131 } 132 133 /** 134 */ 135 136 /** 137 * Warning 138 * 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 139 * Creates a new horizontal button box. 140 * Throws: ConstructionException GTK+ fails to create the object. 141 */ 142 public this () 143 { 144 // GtkWidget * gtk_hbutton_box_new (void); 145 auto p = gtk_hbutton_box_new(); 146 if(p is null) 147 { 148 throw new ConstructionException("null returned by gtk_hbutton_box_new()"); 149 } 150 this(cast(GtkHButtonBox*) p); 151 } 152 }