2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 = GtkButtonBox.html
28 * strct = GtkButtonBox
50 * - GtkWidget* -> Widget
56 private import gtk
.gtktypes
;
58 private import lib
.gtk
;
60 private import gtk
.Widget
;
61 private import gtk
.Button
;
62 private import gtk
.HButtonBox
;
63 private import gtk
.VButtonBox
;
67 * The primary purpose of this class is to keep track of the various properties
68 * of GtkHButtonBox and GtkVButtonBox widgets.
69 * gtk_button_box_get_child_size() retrieves the minimum width and height
70 * for widgets in a given button box. gtk_button_box_set_child_size()
71 * allows those properties to be changed.
72 * The internal padding of buttons can be retrieved and changed per button box using
73 * gtk_button_box_get_child_ipadding() and gtk_button_box_set_child_ipadding()
75 * gtk_button_box_get_spacing() and gtk_button_box_set_spacing() retrieve and
76 * change default number of pixels between buttons, respectively.
77 * gtk_button_box_get_layout() and gtk_button_box_set_layout() retrieve and alter the method
78 * used to spread the buttons in a button box across the container, respectively.
79 * The main purpose of GtkButtonBox is to make sure the children have all the same size.
80 * Therefore it ignores the homogeneous property which it inherited from GtkBox, and always
81 * behaves as if homogeneous was TRUE.
83 private import gtk
.Box
;
84 public class ButtonBox
: Box
87 /** the main Gtk struct */
88 protected GtkButtonBox
* gtkButtonBox
;
91 public GtkButtonBox
* getButtonBoxStruct()
97 /** the main Gtk struct as a void* */
98 protected void* getStruct()
100 return cast(void*)gtkButtonBox
;
104 * Sets our main struct and passes it to the parent class
106 public this (GtkButtonBox
* gtkButtonBox
)
108 super(cast(GtkBox
*)gtkButtonBox
);
109 this.gtkButtonBox
= gtkButtonBox
;
112 static ButtonBox
createActionBox(
113 void delegate(Button
) onClicked
,
122 bBox
= VButtonBox
.createActionBox();
126 bBox
= HButtonBox
.createActionBox();
130 for( int i
=0 ; i
<stocks
.length
&& i
<actions
.length
; i
++)
132 button
= new Button(stocks
[i
]);
133 bBox
.packEnd(button
, false, false, 7);
134 button
.setActionName(actions
[i
]);
135 button
.addOnClicked(onClicked
);
140 static ButtonBox
createOkBox(void delegate(Button
) onClicked
)
142 static StockID
[] stocks
= [StockID
.OK
];
144 actions
~= "action.ok";
145 return createActionBox(onClicked
, stocks
, actions
);
148 static ButtonBox
createOkCancelBox(void delegate(Button
) onClicked
)
150 static StockID
[] stocks
= [StockID
.OK
, StockID
.CANCEL
];
152 actions
~= "action.ok";
153 actions
~= "action.cancel";
154 return createActionBox(onClicked
, stocks
, actions
);
164 * Retrieves the method being used to arrange the buttons in a button box.
168 * the method used to layout buttons in widget.
170 public GtkButtonBoxStyle
getLayout()
172 // GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget);
173 return gtk_button_box_get_layout(gtkButtonBox
);
178 * gtk_button_box_get_child_size is deprecated and should not be used in newly-written code. Use the style properties
179 * "child-min-width/-height" instead.
180 * Retrieves the current width and height of all child widgets in a button box.
181 * min_width and min_height are filled with those values, respectively.
185 * the width of the buttons contained by widget.
187 * the height of the buttons contained by widget.
189 public void getChildSize(int* minWidth
, int* minHeight
)
191 // void gtk_button_box_get_child_size (GtkButtonBox *widget, gint *min_width, gint *min_height);
192 gtk_button_box_get_child_size(gtkButtonBox
, minWidth
, minHeight
);
197 * gtk_button_box_get_child_ipadding is deprecated and should not be used in newly-written code. Use the style properties
198 * "child-internal-pad-x/-y" instead.
199 * Gets the default number of pixels that pad the buttons in a given button box.
203 * the horizontal padding used by buttons in widget.
205 * the vertical padding used by buttons in widget.
207 public void getChildIpadding(int* ipadX
, int* ipadY
)
209 // void gtk_button_box_get_child_ipadding (GtkButtonBox *widget, gint *ipad_x, gint *ipad_y);
210 gtk_button_box_get_child_ipadding(gtkButtonBox
, ipadX
, ipadY
);
214 * Returns whether child should appear in a secondary group of children.
220 * whether child should appear in a secondary group of children.
223 public int getChildSecondary(Widget child
)
225 // gboolean gtk_button_box_get_child_secondary (GtkButtonBox *widget, GtkWidget *child);
226 return gtk_button_box_get_child_secondary(gtkButtonBox
, (child
is null) ?
null : child
.getWidgetStruct());
231 * Changes the way buttons are arranged in their container.
235 * the new layout style.
237 public void setLayout(GtkButtonBoxStyle layoutStyle
)
239 // void gtk_button_box_set_layout (GtkButtonBox *widget, GtkButtonBoxStyle layout_style);
240 gtk_button_box_set_layout(gtkButtonBox
, layoutStyle
);
245 * gtk_button_box_set_child_size is deprecated and should not be used in newly-written code. Use the style properties
246 * "child-min-width/-height" instead.
247 * Sets a new default size for the children of a given button box.
251 * a default width for buttons in widget.
253 * a default height for buttons in widget.
255 public void setChildSize(int minWidth
, int minHeight
)
257 // void gtk_button_box_set_child_size (GtkButtonBox *widget, gint min_width, gint min_height);
258 gtk_button_box_set_child_size(gtkButtonBox
, minWidth
, minHeight
);
263 * gtk_button_box_set_child_ipadding is deprecated and should not be used in newly-written code. Use the style properties
264 * "child-internal-pad-x/-y" instead.
265 * Changes the amount of internal padding used by all buttons in a given button
270 * the horizontal padding that should be used by each button in widget.
272 * the vertical padding that should be used by each button in widget.
274 public void setChildIpadding(int ipadX
, int ipadY
)
276 // void gtk_button_box_set_child_ipadding (GtkButtonBox *widget, gint ipad_x, gint ipad_y);
277 gtk_button_box_set_child_ipadding(gtkButtonBox
, ipadX
, ipadY
);
281 * Sets whether child should appear in a secondary group of children.
282 * A typical use of a secondary child is the help button in a dialog.
283 * This group appears after the other children if the style
284 * is GTK_BUTTONBOX_START, GTK_BUTTONBOX_SPREAD or
285 * GTK_BUTTONBOX_EDGE, and before the other children if the style
286 * is GTK_BUTTONBOX_END. For horizontal button boxes, the definition
287 * of before/after depends on direction of the widget (see
288 * gtk_widget_set_direction()). If the style is GTK_BUTTONBOX_START
289 * or GTK_BUTTONBOX_END, then the secondary children are aligned at
290 * the other end of the button box from the main children. For the
291 * other styles, they appear immediately next to the main children.
297 * if TRUE, the child appears in a secondary group of the
300 * The "layout-style" property
301 * "layout-style" GtkButtonBoxStyle : Read / Write
302 * How to layout the buttons in the box. Possible values are default, spread, edge, start and end.
303 * Default value: GTK_BUTTONBOX_DEFAULT_STYLE
304 * Child Property Details
305 * The "secondary" child property
306 * "secondary" gboolean : Read / Write
307 * If TRUE, the child appears in a secondary group of children, suitable for, e.g., help buttons.
308 * Default value: FALSE
309 * Style Property Details
310 * The "child-internal-pad-x" style property
311 * "child-internal-pad-x" gint : Read
312 * Amount to increase child's size on either side.
313 * Allowed values: >= 0
316 public void setChildSecondary(Widget child
, int isSecondary
)
318 // void gtk_button_box_set_child_secondary (GtkButtonBox *widget, GtkWidget *child, gboolean is_secondary);
319 gtk_button_box_set_child_secondary(gtkButtonBox
, (child
is null) ?
null : child
.getWidgetStruct(), isSecondary
);