alternative to assert
[gtkD.git] / gtkD / src / gtk / HButtonBox.d
blobc585d1fedbe0294697b032615df64a463d323397
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkHButtonBox.html
26 * outPack = gtk
27 * outFile = HButtonBox
28 * strct = GtkHButtonBox
29 * realStrct=
30 * ctorStrct=
31 * clss = HButtonBox
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_hbutton_box_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * structWrap:
46 * module aliases:
47 * local aliases:
50 module gtk.HButtonBox;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.gtktypes;
62 private import gtkc.gtk;
69 /**
70 * Description
71 * A button box should be used to provide a consistent layout of buttons
72 * throughout your application. The layout/spacing can be altered by the
73 * programmer, or if desired, by the user to alter the 'feel' of a
74 * program to a small degree.
75 * A GtkHButtonBox is created with gtk_hbutton_box_new(). Buttons are
76 * packed into a button box the same way widgets are added to any other
77 * container, using gtk_container_add(). You can also use
78 * gtk_box_pack_start() or gtk_box_pack_end(), but for button boxes both
79 * these functions work just like gtk_container_add(), ie., they pack the
80 * button in a way that depends on the current layout style and on
81 * whether the button has had gtk_button_box_set_child_secondary() called
82 * on it.
83 * The spacing between buttons can be set with gtk_box_set_spacing(). The
84 * arrangement and layout of the buttons can be changed with
85 * gtk_button_box_set_layout().
87 private import gtk.ButtonBox;
88 public class HButtonBox : ButtonBox
91 /** the main Gtk struct */
92 protected GtkHButtonBox* gtkHButtonBox;
95 public GtkHButtonBox* getHButtonBoxStruct()
97 return gtkHButtonBox;
101 /** the main Gtk struct as a void* */
102 protected void* getStruct()
104 return cast(void*)gtkHButtonBox;
108 * Sets our main struct and passes it to the parent class
110 public this (GtkHButtonBox* gtkHButtonBox)
112 version(noAssert)
114 if ( gtkHButtonBox is null )
116 int zero = 0;
117 version(Tango)
119 Stdout("struct gtkHButtonBox is null on constructor").newline;
121 else
123 printf("struct gtkHButtonBox is null on constructor");
125 zero = zero / zero;
128 else
130 assert(gtkHButtonBox !is null, "struct gtkHButtonBox is null on constructor");
132 super(cast(GtkButtonBox*)gtkHButtonBox);
133 this.gtkHButtonBox = gtkHButtonBox;
137 * Creates a new HButtonBox and sets comon parameters
139 static ButtonBox createActionBox()
141 ButtonBox bBox = new HButtonBox();
142 bBox.setLayout(ButtonBoxStyle.END);
143 bBox.setBorderWidth(5);
144 bBox.setSpacing(7);
145 return bBox;
154 * Creates a new horizontal button box.
155 * Returns:
156 * a new button box GtkWidget.
158 public this ()
160 // GtkWidget* gtk_hbutton_box_new (void);
161 this(cast(GtkHButtonBox*)gtk_hbutton_box_new() );
165 * Warning
166 * gtk_hbutton_box_get_spacing_default is deprecated and should not be used in newly-written code.
167 * Retrieves the current default spacing for horizontal button boxes. This is the number of pixels
168 * to be placed between the buttons when they are arranged.
169 * Returns:
170 * the default number of pixels between buttons.
172 public static int getSpacingDefault()
174 // gint gtk_hbutton_box_get_spacing_default (void);
175 return gtk_hbutton_box_get_spacing_default();
179 * Warning
180 * gtk_hbutton_box_get_layout_default is deprecated and should not be used in newly-written code.
181 * Retrieves the current layout used to arrange buttons in button box widgets.
182 * Returns:
183 * the current GtkButtonBoxStyle.
185 public static GtkButtonBoxStyle getLayoutDefault()
187 // GtkButtonBoxStyle gtk_hbutton_box_get_layout_default (void);
188 return gtk_hbutton_box_get_layout_default();
192 * Warning
193 * gtk_hbutton_box_set_spacing_default is deprecated and should not be used in newly-written code.
194 * Changes the default spacing that is placed between widgets in an
195 * horizontal button box.
196 * spacing:
197 * an integer value.
199 public static void setSpacingDefault(int spacing)
201 // void gtk_hbutton_box_set_spacing_default (gint spacing);
202 gtk_hbutton_box_set_spacing_default(spacing);
206 * Warning
207 * gtk_hbutton_box_set_layout_default is deprecated and should not be used in newly-written code.
208 * Sets a new layout mode that will be used by all button boxes.
209 * layout:
210 * a new GtkButtonBoxStyle.
211 * See Also
212 * GtkBox
213 * Used to pack widgets into button boxes.
214 * GtkButtonBox
215 * Provides functions for controlling button boxes.
216 * GtkVButtonBox
217 * Pack buttons vertically
219 public static void setLayoutDefault(GtkButtonBoxStyle layout)
221 // void gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout);
222 gtk_hbutton_box_set_layout_default(layout);