alternative to assert
[gtkD.git] / gtkD / src / gtk / VButtonBox.d
blob4dfc3efd0618df9c14935aa642597a4209599d20
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 = GtkVButtonBox.html
26 * outPack = gtk
27 * outFile = VButtonBox
28 * strct = GtkVButtonBox
29 * realStrct=
30 * ctorStrct=
31 * clss = VButtonBox
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_vbutton_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.VButtonBox;
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 GtkVButtonBox is created with gtk_vbutton_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 VButtonBox : ButtonBox
91 /** the main Gtk struct */
92 protected GtkVButtonBox* gtkVButtonBox;
95 public GtkVButtonBox* getVButtonBoxStruct()
97 return gtkVButtonBox;
101 /** the main Gtk struct as a void* */
102 protected void* getStruct()
104 return cast(void*)gtkVButtonBox;
108 * Sets our main struct and passes it to the parent class
110 public this (GtkVButtonBox* gtkVButtonBox)
112 version(noAssert)
114 if ( gtkVButtonBox is null )
116 int zero = 0;
117 version(Tango)
119 Stdout("struct gtkVButtonBox is null on constructor").newline;
121 else
123 printf("struct gtkVButtonBox is null on constructor");
125 zero = zero / zero;
128 else
130 assert(gtkVButtonBox !is null, "struct gtkVButtonBox is null on constructor");
132 super(cast(GtkButtonBox*)gtkVButtonBox);
133 this.gtkVButtonBox = gtkVButtonBox;
137 * Creates a new vertical button box and sets standart values for it's comon parameters
138 * @return a new vertical button box
140 static ButtonBox createActionBox()
142 ButtonBox bBox = new VButtonBox();
143 bBox.setLayout(ButtonBoxStyle.START);
144 bBox.setBorderWidth(5);
145 bBox.setSpacing(7);
146 return bBox;
154 * Creates a new vertical button box.
155 * Returns:
156 * a new button box GtkWidget.
158 public this ()
160 // GtkWidget* gtk_vbutton_box_new (void);
161 this(cast(GtkVButtonBox*)gtk_vbutton_box_new() );
165 * Warning
166 * gtk_vbutton_box_get_spacing_default is deprecated and should not be used in newly-written code.
167 * Retrieves the current default spacing for vertical 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_vbutton_box_get_spacing_default (void);
175 return gtk_vbutton_box_get_spacing_default();
179 * Warning
180 * gtk_vbutton_box_set_spacing_default is deprecated and should not be used in newly-written code.
181 * Changes the default spacing that is placed between widgets in an
182 * vertical button box.
183 * spacing:
184 * an integer value.
186 public static void setSpacingDefault(int spacing)
188 // void gtk_vbutton_box_set_spacing_default (gint spacing);
189 gtk_vbutton_box_set_spacing_default(spacing);
193 * Warning
194 * gtk_vbutton_box_get_layout_default is deprecated and should not be used in newly-written code.
195 * Retrieves the current layout used to arrange buttons in button box widgets.
196 * Returns:
197 * the current GtkButtonBoxStyle.
199 public static GtkButtonBoxStyle getLayoutDefault()
201 // GtkButtonBoxStyle gtk_vbutton_box_get_layout_default (void);
202 return gtk_vbutton_box_get_layout_default();
206 * Warning
207 * gtk_vbutton_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 * GtkHButtonBox
217 * Pack buttons horizontally
219 public static void setLayoutDefault(GtkButtonBoxStyle layout)
221 // void gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout);
222 gtk_vbutton_box_set_layout_default(layout);