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 = GtkTable.html
48 * - GtkWidget* -> Widget
54 private import gtk
.gtktypes
;
56 private import lib
.gtk
;
58 private import gtk
.Widget
;
62 * The GtkTable functions allow the programmer to arrange widgets in rows and
63 * columns, making it easy to align many widgets next to each other,
64 * horizontally and vertically.
65 * Tables are created with a call to gtk_table_new(), the size of which can
66 * later be changed with gtk_table_resize().
67 * Widgets can be added to a table using gtk_table_attach() or the more
68 * convenient (but slightly less flexible) gtk_table_attach_defaults().
69 * To alter the space next to a specific row, use gtk_table_set_row_spacing(),
70 * and for a column, gtk_table_set_col_spacing().
71 * The gaps between all rows or columns can be changed by calling
72 * gtk_table_set_row_spacings() or gtk_table_set_col_spacings() respectively.
73 * gtk_table_set_homogeneous(), can be used to set whether all cells in the
74 * table will resize themselves to the size of the largest widget in the table.
76 private import gtk
.Container
;
77 public class Table
: Container
80 /** the main Gtk struct */
81 protected GtkTable
* gtkTable
;
84 public GtkTable
* getTableStruct()
90 /** the main Gtk struct as a void* */
91 protected void* getStruct()
93 return cast(void*)gtkTable
;
97 * Sets our main struct and passes it to the parent class
99 public this (GtkTable
* gtkTable
)
101 super(cast(GtkContainer
*)gtkTable
);
102 this.gtkTable
= gtkTable
;
110 public AttachOptions defaultXOption
= AttachOptions
.SHRINK
;
111 public AttachOptions defaultYOption
= AttachOptions
.SHRINK
;
114 * Removes all children and resizes the table to 1,1
123 * Used to create a new table widget. An initial size must be given by
124 * specifying how many rows and columns the table should have, although
125 * this can be changed later with gtk_table_resize(). rows and columns
126 * must both be in the range 0 .. 65535.
128 * The number of rows the new table should have.
130 * The number of columns the new table should have.
132 * If set to TRUE, all table cells are resized to the size of the cell
133 * containing the largest widget.
135 * A pointer to the the newly created table widget.
137 public this (uint rows
, uint columns
, int homogeneous
)
139 // GtkWidget* gtk_table_new (guint rows, guint columns, gboolean homogeneous);
140 this(cast(GtkTable
*)gtk_table_new(rows
, columns
, homogeneous
) );
149 * Attach a new widget creating a new row if necessary
151 void attach(Widget child
)
153 attach(child
, col
, col
+ 1, row
, row
+ 1,
154 defaultXOption
, defaultYOption
,
155 getDefaultColSpacing(), getDefaultRowSpacing());
173 * If you need to change a table's size after it has been created, this function allows you to do so.
175 * The GtkTable you wish to change the size of.
177 * The new number of rows.
179 * The new number of columns.
181 public void resize(uint rows
, uint columns
)
183 // void gtk_table_resize (GtkTable *table, guint rows, guint columns);
184 gtk_table_resize(gtkTable
, rows
, columns
);
188 * Adds a widget to a table. The number of 'cells' that a widget will occupy is
189 * specified by left_attach, right_attach, top_attach and bottom_attach.
190 * These each represent the leftmost, rightmost, uppermost and lowest column
191 * and row numbers of the table. (Columns and rows are indexed from zero).
193 * The GtkTable to add a new widget to.
197 * the column number to attach the left side of a child widget to.
199 * the column number to attach the right side of a child widget to.
201 * the row number to attach the top of a child widget to.
203 * the row number to attach the bottom of a child widget to.
205 * Used to specify the properties of the child widget when the table is resized.
207 * The same as xoptions, except this field determines behaviour of vertical resizing.
209 * An integer value specifying the padding on the left and right of the widget being added to the table.
211 * The amount of padding above and below the child widget.
213 public void attach(Widget child
, uint leftAttach
, uint rightAttach
, uint topAttach
, uint bottomAttach
, GtkAttachOptions xoptions
, GtkAttachOptions yoptions
, uint xpadding
, uint ypadding
)
215 // void gtk_table_attach (GtkTable *table, GtkWidget *child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, GtkAttachOptions xoptions, GtkAttachOptions yoptions, guint xpadding, guint ypadding);
216 gtk_table_attach(gtkTable
, (child
is null) ?
null : child
.getWidgetStruct(), leftAttach
, rightAttach
, topAttach
, bottomAttach
, xoptions
, yoptions
, xpadding
, ypadding
);
220 * As there are many options associated with gtk_table_attach(), this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options. The values used for the GtkAttachOptions are GTK_EXPAND | GTK_FILL, and the padding is set to 0.
222 * The table to add a new child widget to.
224 * The child widget to add.
226 * The column number to attach the left side of the child widget to.
228 * The column number to attach the right side of the child widget to.
230 * The row number to attach the top of the child widget to.
232 * The row number to attach the bottom of the child widget to.
234 public void attachDefaults(Widget widget
, uint leftAttach
, uint rightAttach
, uint topAttach
, uint bottomAttach
)
236 // void gtk_table_attach_defaults (GtkTable *table, GtkWidget *widget, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach);
237 gtk_table_attach_defaults(gtkTable
, (widget
is null) ?
null : widget
.getWidgetStruct(), leftAttach
, rightAttach
, topAttach
, bottomAttach
);
241 * Changes the space between a given table row and the subsequent row.
243 * a GtkTable containing the row whose properties you wish to change.
245 * row number whose spacing will be changed.
247 * number of pixels that the spacing should take up.
249 public void setRowSpacing(uint row
, uint spacing
)
251 // void gtk_table_set_row_spacing (GtkTable *table, guint row, guint spacing);
252 gtk_table_set_row_spacing(gtkTable
, row
, spacing
);
256 * Alters the amount of space between a given table column and the following
261 * the column whose spacing should be changed.
263 * number of pixels that the spacing should take up.
265 public void setColSpacing(uint column
, uint spacing
)
267 // void gtk_table_set_col_spacing (GtkTable *table, guint column, guint spacing);
268 gtk_table_set_col_spacing(gtkTable
, column
, spacing
);
272 * Sets the space between every row in table equal to spacing.
276 * the number of pixels of space to place between every row in the table.
278 public void setRowSpacings(uint spacing
)
280 // void gtk_table_set_row_spacings (GtkTable *table, guint spacing);
281 gtk_table_set_row_spacings(gtkTable
, spacing
);
285 * Sets the space between every column in table equal to spacing.
289 * the number of pixels of space to place between every column in the table.
291 public void setColSpacings(uint spacing
)
293 // void gtk_table_set_col_spacings (GtkTable *table, guint spacing);
294 gtk_table_set_col_spacings(gtkTable
, spacing
);
298 * Changes the homogenous property of table cells, ie. whether all cells are an equal size or not.
300 * The GtkTable you wish to set the homogeneous properties of.
302 * Set to TRUE to ensure all table cells are the same size. Set
303 * to FALSE if this is not your desired behaviour.
305 public void setHomogeneous(int homogeneous
)
307 // void gtk_table_set_homogeneous (GtkTable *table, gboolean homogeneous);
308 gtk_table_set_homogeneous(gtkTable
, homogeneous
);
312 * Gets the default row spacing for the table. This is
313 * the spacing that will be used for newly added rows.
314 * (See gtk_table_set_row_spacings())
318 * value: the default row spacing
320 public uint getDefaultRowSpacing()
322 // guint gtk_table_get_default_row_spacing (GtkTable *table);
323 return gtk_table_get_default_row_spacing(gtkTable
);
327 * Returns whether the table cells are all constrained to the same
328 * width and height. (See gtk_table_set_homogenous())
332 * TRUE if the cells are all constrained to the same size
334 public int getHomogeneous()
336 // gboolean gtk_table_get_homogeneous (GtkTable *table);
337 return gtk_table_get_homogeneous(gtkTable
);
341 * Gets the amount of space between row row, and
342 * row row + 1. See gtk_table_set_row_spacing().
346 * a row in the table, 0 indicates the first row
350 public uint getRowSpacing(uint row
)
352 // guint gtk_table_get_row_spacing (GtkTable *table, guint row);
353 return gtk_table_get_row_spacing(gtkTable
, row
);
357 * Gets the amount of space between column col, and
358 * column col + 1. See gtk_table_set_col_spacing().
362 * a column in the table, 0 indicates the first column
366 public uint getColSpacing(uint column
)
368 // guint gtk_table_get_col_spacing (GtkTable *table, guint column);
369 return gtk_table_get_col_spacing(gtkTable
, column
);
373 * Gets the default column spacing for the table. This is
374 * the spacing that will be used for newly added columns.
375 * (See gtk_table_set_col_spacings())
379 * value: the default column spacing
381 * The "column-spacing" property
382 * "column-spacing" guint : Read / Write
383 * The amount of space between two consecutive columns.
386 public uint getDefaultColSpacing()
388 // guint gtk_table_get_default_col_spacing (GtkTable *table);
389 return gtk_table_get_default_col_spacing(gtkTable
);