|
Etk_Alignment
Detailed Description
The Etk_Alignment widget is a container that can contain one child which can be aligned and scaled inside the container.
The scale settings control how much the child should expand to fill the available space, from 0.0 (the child doesn't expand at all) to 1.0 (the child takes up all the available space).
The align settings control the alignment of the child inside the container, from 0.0 (the child is aligned on the left/top) to 1.0 (the child is aligned on the right/bottom).
The align settings have no effect if the scale factors are set to 1.0.
- Object Hierarchy:
-
- Properties:
- "xalign": Horizontal alignment of the child in the available space, from 0.0 (left) to 1.0 (right).
Type: FloatAccess: Read/WriteDefault Value: 0.5
- "yalign": Vertical alignment of the child in the available space, from 0.0 (top) to 1.0 (bottom).
Type: FloatAccess: Read/WriteDefault Value: 0.5
- "xscale": How much of the horizontal space the child should use, from 0.0 (none, the child does not expand) to 1.0 (the child fills all the horizontal space).
Type: FloatAccess: Read/WriteDefault Value: 1.0
- "yscale": How much of the vertical space the child should use, from 0.0 (none, the child does not expand) to 1.0 (the child fills all the vertical space).
Type: FloatAccess: Read/WriteDefault Value: 1.0
|
Data Structures |
struct | Etk_Alignment |
| [Widget] A container containing one child which can be aligned and scaled More...
|
Defines |
#define | ETK_ALIGNMENT_TYPE (etk_alignment_type_get()) |
#define | ETK_ALIGNMENT(obj) (ETK_OBJECT_CAST((obj), ETK_ALIGNMENT_TYPE, Etk_Alignment)) |
#define | ETK_IS_ALIGNMENT(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_ALIGNMENT_TYPE)) |
Functions |
Etk_Widget * | etk_alignment_new (float xalign, float yalign, float xscale, float yscale) |
| Creates a new alignment.
|
void | etk_alignment_set (Etk_Alignment *alignment, float xalign, float yalign, float xscale, float yscale) |
| Changes the parameters of the alignment.
|
void | etk_alignment_get (Etk_Alignment *alignment, float *xalign, float *yalign, float *xscale, float *yscale) |
| Gets the different parameters of the alignment.
|
Define Documentation
#define ETK_ALIGNMENT_TYPE (etk_alignment_type_get()) |
Gets the type of an alignment
#define ETK_ALIGNMENT |
( |
obj |
|
) |
(ETK_OBJECT_CAST((obj), ETK_ALIGNMENT_TYPE, Etk_Alignment)) |
#define ETK_IS_ALIGNMENT |
( |
obj |
|
) |
(ETK_OBJECT_CHECK_TYPE((obj), ETK_ALIGNMENT_TYPE)) |
Function Documentation
Etk_Widget * etk_alignment_new |
( |
float |
xalign, |
|
|
float |
yalign, |
|
|
float |
xscale, |
|
|
float |
yscale | |
|
) |
| | |
Creates a new alignment.
- Parameters:
-
| xalign | the horizontal alignment, from 0.0 (left) to 1.0 (right) |
| yalign | the vertical alignment, from 0.0 (top) to 1.0 (bottom) |
| xscale | the horizontal scale factor, from 0.0 (do not scale) to 1.0 (fill all the available space) |
| yscale | the vertical scale factor, from 0.0 (do not scale) to 1.0 (fill all the available space) |
- Returns:
- Returns the new alignment widget
void etk_alignment_set |
( |
Etk_Alignment * |
alignment, |
|
|
float |
xalign, |
|
|
float |
yalign, |
|
|
float |
xscale, |
|
|
float |
yscale | |
|
) |
| | |
Changes the parameters of the alignment.
- Parameters:
-
| alignment | an alignment |
| xalign | the horizontal alignment, from 0.0 (left) to 1.0 (right) |
| yalign | the vertical alignment, from 0.0 (top) to 1.0 (bottom) |
| xscale | the horizontal scale factor, from 0.0 (do not scale) to 1.0 (fill all the available space) |
| yscale | the vertical scale factor, from 0.0 (do not scale) to 1.0 (fill all the available space) |
void etk_alignment_get |
( |
Etk_Alignment * |
alignment, |
|
|
float * |
xalign, |
|
|
float * |
yalign, |
|
|
float * |
xscale, |
|
|
float * |
yscale | |
|
) |
| | |
Gets the different parameters of the alignment.
- Parameters:
-
| alignment | an alignment |
| xalign | the location where to store the horizontal alignment |
| yalign | the location where to store the vertical alignment |
| xscale | the location where to store the horizontal scale factor |
| yscale | the location where to store the vertical scale factor |
|
|