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 * - gtk_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * structWrap: 48 * module aliases: 49 * local aliases: 50 * overrides: 51 */ 52 53 module gtk.HButtonBox; 54 55 public import gtkc.gtktypes; 56 57 private import gtkc.gtk; 58 private import glib.ConstructionException; 59 private import gobject.ObjectG; 60 61 62 63 64 65 private import gtk.ButtonBox; 66 67 /** 68 * Description 69 * A button box should be used to provide a consistent layout of buttons 70 * throughout your application. The layout/spacing can be altered by the 71 * programmer, or if desired, by the user to alter the 'feel' of a 72 * program to a small degree. 73 * A GtkHButtonBox is created with gtk_hbutton_box_new(). Buttons are 74 * packed into a button box the same way widgets are added to any other 75 * container, using gtk_container_add(). You can also use 76 * gtk_box_pack_start() or gtk_box_pack_end(), but for button boxes both 77 * these functions work just like gtk_container_add(), ie., they pack the 78 * button in a way that depends on the current layout style and on 79 * whether the button has had gtk_button_box_set_child_secondary() called 80 * on it. 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 public class HButtonBox : ButtonBox 86 { 87 88 /** the main Gtk struct */ 89 protected GtkHButtonBox* gtkHButtonBox; 90 91 92 public GtkHButtonBox* getHButtonBoxStruct() 93 { 94 return gtkHButtonBox; 95 } 96 97 98 /** the main Gtk struct as a void* */ 99 protected override void* getStruct() 100 { 101 return cast(void*)gtkHButtonBox; 102 } 103 104 /** 105 * Sets our main struct and passes it to the parent class 106 */ 107 public this (GtkHButtonBox* gtkHButtonBox) 108 { 109 super(cast(GtkButtonBox*)gtkHButtonBox); 110 this.gtkHButtonBox = gtkHButtonBox; 111 } 112 113 protected override void setStruct(GObject* obj) 114 { 115 super.setStruct(obj); 116 gtkHButtonBox = cast(GtkHButtonBox*)obj; 117 } 118 119 /** 120 * Creates a new HButtonBox and sets comon parameters 121 */ 122 static HButtonBox createActionBox() 123 { 124 HButtonBox bBox = new HButtonBox(); 125 bBox.setLayout(ButtonBoxStyle.END); 126 bBox.setBorderWidth(5); 127 bBox.setSpacing(7); 128 return bBox; 129 } 130 131 132 /** 133 */ 134 135 /** 136 * Creates a new horizontal button box. 137 * Throws: ConstructionException GTK+ fails to create the object. 138 */ 139 public this () 140 { 141 // GtkWidget * gtk_hbutton_box_new (void); 142 auto p = gtk_hbutton_box_new(); 143 if(p is null) 144 { 145 throw new ConstructionException("null returned by gtk_hbutton_box_new()"); 146 } 147 this(cast(GtkHButtonBox*) p); 148 } 149 150 /** 151 * Warning 152 * gtk_hbutton_box_get_spacing_default is deprecated and should not be used in newly-written code. 153 * Retrieves the current default spacing for horizontal button boxes. This is the number of pixels 154 * to be placed between the buttons when they are arranged. 155 * Returns: the default number of pixels between buttons. 156 */ 157 public static int getSpacingDefault() 158 { 159 // gint gtk_hbutton_box_get_spacing_default (void); 160 return gtk_hbutton_box_get_spacing_default(); 161 } 162 163 /** 164 * Warning 165 * gtk_hbutton_box_get_layout_default is deprecated and should not be used in newly-written code. 166 * Retrieves the current layout used to arrange buttons in button box widgets. 167 * Returns: the current GtkButtonBoxStyle. 168 */ 169 public static GtkButtonBoxStyle getLayoutDefault() 170 { 171 // GtkButtonBoxStyle gtk_hbutton_box_get_layout_default (void); 172 return gtk_hbutton_box_get_layout_default(); 173 } 174 175 /** 176 * Warning 177 * gtk_hbutton_box_set_spacing_default is deprecated and should not be used in newly-written code. 178 * Changes the default spacing that is placed between widgets in an 179 * horizontal button box. 180 * Params: 181 * spacing = an integer value. 182 */ 183 public static void setSpacingDefault(int spacing) 184 { 185 // void gtk_hbutton_box_set_spacing_default (gint spacing); 186 gtk_hbutton_box_set_spacing_default(spacing); 187 } 188 189 /** 190 * Warning 191 * gtk_hbutton_box_set_layout_default is deprecated and should not be used in newly-written code. 192 * Sets a new layout mode that will be used by all button boxes. 193 * Params: 194 * layout = a new GtkButtonBoxStyle. 195 */ 196 public static void setLayoutDefault(GtkButtonBoxStyle layout) 197 { 198 // void gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout); 199 gtk_hbutton_box_set_layout_default(layout); 200 } 201 }