Ewl_Box: The Box Layout Container.
Detailed Description
Defines the Ewl_Box class used for laying out Ewl_Widget's in a horizontal or vertical line.
- Remarks:
- Inherits from Ewl_Container.
Tutorial
The Ewl_Box provides a simple linear layout container. There are a few options to control the layout characteristics, but much of the layout is dependent on the child widget settings. The first option encountered is the orientation, which is either horizontal or vertical. Both orientations are implemented within the same box widget, and is set with ewl_box_orientation_set, but shortcuts exist in the form of ewl_hbox_new and ewl_vbox_new. The default orientation is horizontal.
Ewl_Widget *box; box = ewl_hbox_new(); ewl_widget_show(box);
After creating the box, children are added with the standard container calls common to most containers. For example, a label and entry would be added as follows.
ewl_container_child_append(EWL_CONTAINER(box), label); ewl_container_child_append(EWL_CONTAINER(box), entry);
This would result in a label followed by the entry laid out horizontally.
Data Structures | |
struct | Ewl_Box |
Inherits from an Ewl_Container to provide layout facilities for child widgets placed inside. More... | |
Defines | |
#define | EWL_BOX(box) ((Ewl_Box *) box) |
#define | EWL_BOX_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_BOX_TYPE)) |
#define | EWL_BOX_TYPE "box" |
Typedefs | |
typedef Ewl_Box | Ewl_Box |
Functions | |
void | ewl_box_cb_child_hide (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_box_cb_child_homogeneous_resize (Ewl_Container *c, Ewl_Widget *w, int size, Ewl_Orientation o) |
void | ewl_box_cb_child_homogeneous_show (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_box_cb_child_resize (Ewl_Container *c, Ewl_Widget *w, int size, Ewl_Orientation o) |
void | ewl_box_cb_child_show (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_box_cb_configure (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_box_cb_configure_homogeneous (Ewl_Widget *w, void *ev_data, void *user_data) |
unsigned int | ewl_box_homogeneous_get (Ewl_Box *b) |
Retrieves the layout of the box. | |
void | ewl_box_homogeneous_set (Ewl_Box *b, unsigned int h) |
Change the homogeneous layout of the box, setting TRUE will give all children the same size. | |
int | ewl_box_init (Ewl_Box *box) |
Initialize the box to starting values. | |
Ewl_Widget * | ewl_box_new (void) |
Allocate and initialize a new box with given orientation. | |
Ewl_Orientation | ewl_box_orientation_get (Ewl_Box *b) |
Retrieves the orientation of the box. | |
void | ewl_box_orientation_set (Ewl_Box *b, Ewl_Orientation o) |
Change the specified box's orientation. | |
void | ewl_box_spacing_set (Ewl_Box *b, int spacing) |
Changes the spacing between the objects in the box. | |
Ewl_Widget * | ewl_hbox_new (void) |
Allocate and initialize a new box with horizontal orientation. | |
Ewl_Widget * | ewl_vbox_new (void) |
Allocate and initialize a new box with vertical orientation. |
Define Documentation
#define EWL_BOX_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_BOX_TYPE)) |
Returns TRUE if the widget is an Ewl_Box, FALSE otherwise
#define EWL_BOX_TYPE "box" |
The type name for the Ewl_Box widget
Typedef Documentation
The box widget is an Ewl_Container and lays out Ewl_Widget's either horizontally or vertically.
Function Documentation
void ewl_box_cb_child_hide | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
void ewl_box_cb_child_homogeneous_resize | ( | Ewl_Container * | c, | |
Ewl_Widget * | w, | |||
int | size, | |||
Ewl_Orientation | o | |||
) |
void ewl_box_cb_child_homogeneous_show | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
void ewl_box_cb_child_resize | ( | Ewl_Container * | c, | |
Ewl_Widget * | w, | |||
int | size, | |||
Ewl_Orientation | o | |||
) |
void ewl_box_cb_child_show | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
void ewl_box_cb_configure | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
void ewl_box_cb_configure_homogeneous | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
unsigned int ewl_box_homogeneous_get | ( | Ewl_Box * | b | ) |
Retrieves the layout of the box.
- Parameters:
-
b,: the box to retrieve layout
- Returns:
- Returns the homogeneous layout value of the box b.
void ewl_box_homogeneous_set | ( | Ewl_Box * | b, | |
unsigned int | h | |||
) |
Change the homogeneous layout of the box, setting TRUE will give all children the same size.
- Parameters:
-
b,: the box to change homogeneous layout h,: the boolean value to change the layout mode to
- Returns:
- Returns no value.
int ewl_box_init | ( | Ewl_Box * | b | ) |
Initialize the box to starting values.
- Parameters:
-
b,: the box to initialize
- Returns:
- Returns no value.
Ewl_Widget* ewl_box_new | ( | void | ) |
Allocate and initialize a new box with given orientation.
- Returns:
- Returns NULL on failure, or a newly allocated box on success.
Ewl_Orientation ewl_box_orientation_get | ( | Ewl_Box * | b | ) |
Retrieves the orientation of the box.
- Parameters:
-
b,: the box to retrieve orientation
- Returns:
- Returns the orientation value of the box b.
void ewl_box_orientation_set | ( | Ewl_Box * | b, | |
Ewl_Orientation | o | |||
) |
Change the specified box's orientation.
- Parameters:
-
b,: the box to change the orientation o,: the orientation to set for the box
- Returns:
- Returns no value.
void ewl_box_spacing_set | ( | Ewl_Box * | b, | |
int | s | |||
) |
Changes the spacing between the objects in the box.
- Parameters:
-
b,: the box to change the spacing s,: the spacing to put between the child widgets
- Returns:
- Returns no value.
Ewl_Widget* ewl_hbox_new | ( | void | ) |
Allocate and initialize a new box with horizontal orientation.
- Returns:
- Returns NULL on failure, or a newly allocated horizontal box on success.
Ewl_Widget* ewl_vbox_new | ( | void | ) |
Allocate and initialize a new box with vertical orientation.
- Returns:
- Returns NULL on failure, or a newly allocated vertical box on success.