Download

Support

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.

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 struct 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_Widgetewl_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_Widgetewl_hbox_new (void)
 Allocate and initialize a new box with horizontal orientation.
Ewl_Widgetewl_vbox_new (void)
 Allocate and initialize a new box with vertical orientation.

Define Documentation

#define EWL_BOX_IS (  )     (ewl_widget_type_is(EWL_WIDGET(w), EWL_BOX_TYPE))

Returns TRUE if the widget is an Ewl_Box, FALSE otherwise


Typedef Documentation

typedef struct Ewl_Box Ewl_Box

The box widget is an Ewl_Container and lays out Ewl_Widget's either horizontally or vertically.


Function Documentation

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.

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BOX_TYPE, and homogeneous.

Referenced by ewl_notebook_tabbar_homogeneous_get().

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.

References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_box_init(), EWL_WIDGET, ewl_widget_destroy(), and NEW.

Referenced by ewl_hbox_new(), and ewl_vbox_new().

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.

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BOX_TYPE, and orientation.

Referenced by ewl_menu_cb_configure(), ewl_menubar_orientation_get(), ewl_scrollbar_cb_scroll_start(), ewl_scrollbar_orientation_get(), and ewl_scrollbar_orientation_set().

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. Adjust the spacing of the specified box and reconfigure it to change the appearance.

References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_BOX_TYPE, EWL_CONTAINER, ewl_container_child_count_visible_get(), EWL_OBJECT, ewl_object_preferred_inner_h_set(), ewl_object_preferred_inner_w_set(), EWL_ORIENTATION_HORIZONTAL, EWL_WIDGET, ewl_widget_configure(), orientation, PREFERRED_H, PREFERRED_W, and spacing.

Referenced by ewl_icon_init().

Ewl_Widget* ewl_hbox_new ( void   ) 


Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Sat May 17 16:51:08 2008