![]() |
![]() |
![]() |
Moblin UI Toolkit Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
MxGrid; ClutterActor * mx_grid_new (void); void mx_grid_set_end_align (MxGrid *self, gboolean value); gboolean mx_grid_get_end_align (MxGrid *self); void mx_grid_set_homogenous_rows (MxGrid *self, gboolean value); gboolean mx_grid_get_homogenous_rows (MxGrid *self); void mx_grid_set_homogenous_columns (MxGrid *self, gboolean value); gboolean mx_grid_get_homogenous_columns (MxGrid *self); void mx_grid_set_vertical (MxGrid *self, gboolean value); gboolean mx_grid_get_vertical (MxGrid *self); void mx_grid_set_row_spacing (MxGrid *self, gfloat value); gfloat mx_grid_get_row_spacing (MxGrid *self); void mx_grid_set_column_spacing (MxGrid *self, gfloat value); gfloat mx_grid_get_column_spacing (MxGrid *self); void mx_grid_set_valign (MxGrid *self, gdouble value); gdouble mx_grid_get_valign (MxGrid *self); void mx_grid_set_halign (MxGrid *self, gdouble value); gdouble mx_grid_get_halign (MxGrid *self); void mx_grid_set_max_stride (MxGrid *self, gint value); gint mx_grid_get_max_stride (MxGrid *self);
GObject +----GInitiallyUnowned +----ClutterActor +----MxWidget +----MxGrid +----MxItemView
MxGrid implements ClutterScriptable, MxStylable, ClutterContainer and MxScrollable.
"allocate-hidden" gboolean : Read / Write / Construct "column-spacing" gfloat : Read / Write / Construct "end-align" gboolean : Read / Write / Construct "halign" gdouble : Read / Write / Construct "homogenous-columns" gboolean : Read / Write / Construct "homogenous-rows" gboolean : Read / Write / Construct "max-stride" gint : Read / Write / Construct "row-spacing" gfloat : Read / Write / Construct "valign" gdouble : Read / Write / Construct "vertical" gboolean : Read / Write / Construct
MxGrid is a layout container that arranges its children by placing them in a single line and wrapping round to a new line when the edge of the container is reached.
This layout is particularly flexible, with the following configuration possibilities:
Column and row spacing are controllable ("column_spacing" and "row_spacing")
Column and row sizes can be made consistent, regardless of the size of the contained actors ("homogenous_columns" and "homogenous_rows")
Prefer to pack children vertically first, rather than horizontally ("vertical")
Specify the maximum number of rows or columns to allow in the layout, to prevent it from being excessively stretched ("max_stride").
To demonstrate how these settings interact, here are a few images.
Figure 5. MxGrid flowing across multiple rows
An MxGrid containing 9 child actors; "vertical" is set to the default (FALSE, i.e. lay out horizontally first); "max_stride" has not been set (so there's no maximum row size); "column_spacing" and "row_spacing" have been set so that there is spacing between cells vertically and horizontally.
Figure 6. MxGrid flowing on a single row
The image shows the same MxGrid with its children flowing into one row. This is the layout's response to being resized horizontally.
Figure 7. MxGrid flowing onto two rows
The same MxGrid with 9 children wrapping onto two rows: notice how the "odd" rectangle is on the end of a row, rather than at the bottom of a column. This is because preference is being given to packing onto the end of rows, rather than columns, because "vertical" is set to FALSE. Even though there is room for the rectangle at the bottom of the column, the layout prefers to place children onto the end of a row if there is room.
Figure 8. MxGrid flowing into two columns
The same MxGrid 9 children with "vertical" set to TRUE. This time, the layout wraps onto two columns rather than two rows. Even though there is room on the end of the rows for the children, the preference is for them to be placed on the bottom of columns, or into new columns, before being added to rows.
typedef struct _MxGrid MxGrid;
The contents of the this structure are private and should only be accessed through the public API.
void mx_grid_set_homogenous_rows (MxGrid *self, gboolean value);
|
|
|
gboolean mx_grid_get_homogenous_rows (MxGrid *self);
|
|
Returns : |
void mx_grid_set_homogenous_columns (MxGrid *self, gboolean value);
|
|
|
gboolean mx_grid_get_homogenous_columns (MxGrid *self);
|
|
Returns : |
void mx_grid_set_row_spacing (MxGrid *self, gfloat value);
|
|
|
void mx_grid_set_column_spacing (MxGrid *self, gfloat value);
|
|
|
"allocate-hidden"
property"allocate-hidden" gboolean : Read / Write / Construct
This flag determines whether hidden children should be treated allocated or whether they should be skipped from the allocation and treated as if they are not present.
Default value: FALSE
"column-spacing"
property"column-spacing" gfloat : Read / Write / Construct
spacing between columns in the layout.
Allowed values: >= 0
Default value: 0
"end-align"
property"end-align" gboolean : Read / Write / Construct
Right/bottom aligned rows/columns.
Default value: FALSE
"halign"
property"halign" gdouble : Read / Write / Construct
Horizontal alignment of items within cells.
Allowed values: [0,1]
Default value: 0
"homogenous-columns"
property"homogenous-columns" gboolean : Read / Write / Construct
Should all columns have the same height?.
Default value: FALSE
"homogenous-rows"
property"homogenous-rows" gboolean : Read / Write / Construct
Should all rows have the same height?.
Default value: FALSE
"max-stride"
property"max-stride" gint : Read / Write / Construct
Maximum number of rows or columns, depending on orientation. For example, if max-stride is set to 3 with vertical FALSE, there will be a maximum of 3 children in a row; if vertical is TRUE, there will be a maximum of 3 children in a column.
Allowed values: >= 0
Default value: 0
"row-spacing"
property"row-spacing" gfloat : Read / Write / Construct
spacing between rows in the layout.
Allowed values: >= 0
Default value: 0
"valign"
property"valign" gdouble : Read / Write / Construct
Vertical alignment of items within cells.
Allowed values: [0,1]
Default value: 0