Download

Support

Ewl_Paned: A paned widget


Detailed Description

Provides a widget to have a resizable paned container

Remarks:
Inherits from Ewl_Container.

Information

The Ewl_Paned widget is designed to hold multiple panes if needed. If you want to have three panes or four panges just add the panes and it will add the grabbers as needed. The paned widget is an Ewl_Container so to add panes you just use the container functions to append, prepend and insert as needed.

Initial Layout

If you need to set the initial sizes of the items in the grabber then you can use the following lines:

This will set the initial size of the child to 100 px.


Data Structures

struct  Ewl_Paned
 Inherits from Ewl_Container and extends to provided the paned widget. More...
struct  Ewl_Paned_Grabber
 Inherits from Ewl_Separator and extends to facilitate the paned grabber. More...
struct  Ewl_Paned_Size_Info
 Holds some information about the children. It is only used internally. More...

Defines

#define EWL_PANED(paned)   ((Ewl_Paned *) paned)
#define EWL_PANED_GRABBER(g)   ((Ewl_Paned_Grabber *)g)
#define EWL_PANED_GRABBER_IS(w)   (ewl_widget_type_is(EWL_WIDGET(w), EWL_PANED_GRABBER_TYPE))
#define EWL_PANED_GRABBER_TYPE   "paned_grabber"
#define EWL_PANED_IS(w)   (ewl_widget_type_is(EWL_WIDGET(w), EWL_PANED_TYPE))
#define EWL_PANED_TYPE   "paned"

Typedefs

typedef struct Ewl_Paned Ewl_Paned
typedef struct Ewl_Paned_Grabber Ewl_Paned_Grabber
typedef struct Ewl_Paned_Size_Info Ewl_Paned_Size_Info

Functions

Ewl_Widgetewl_hpaned_new (void)
 Allocate and initialize a new paned widget with horizontal orientation.
void ewl_paned_arrange (Ewl_Paned *p, int pane_num)
 The arrange the child widgets.
void ewl_paned_cb_child_add (Ewl_Container *c, Ewl_Widget *w)
void ewl_paned_cb_child_hide (Ewl_Container *c, Ewl_Widget *w)
void ewl_paned_cb_child_remove (Ewl_Container *c, Ewl_Widget *w, int idx)
void ewl_paned_cb_child_resize (Ewl_Container *c, Ewl_Widget *w, int size, Ewl_Orientation o)
void ewl_paned_cb_child_show (Ewl_Container *c, Ewl_Widget *w)
void ewl_paned_cb_configure (Ewl_Widget *w, void *ev, void *data)
void ewl_paned_cb_destroy (Ewl_Widget *w, void *ev, void *data)
unsigned int ewl_paned_fixed_size_get (Ewl_Paned *p, Ewl_Widget *child)
 Retrieves if the pane is set to keep its size while resizing.
void ewl_paned_fixed_size_set (Ewl_Paned *p, Ewl_Widget *child, unsigned int fixed)
 Set the given widget to resize only by the grabber.
int ewl_paned_grabber_init (Ewl_Paned_Grabber *g)
Ewl_Widgetewl_paned_grabber_new (void)
Ewl_Orientation ewl_paned_grabber_orientation_get (Ewl_Paned_Grabber *g)
void ewl_paned_grabber_paned_orientation_set (Ewl_Paned_Grabber *g, Ewl_Orientation o)
void ewl_paned_grabber_show_cursor_for (Ewl_Paned_Grabber *g, unsigned int dir)
int ewl_paned_init (Ewl_Paned *p)
 Initialize a new paned widget to default values.
int ewl_paned_initial_size_get (Ewl_Paned *p, Ewl_Widget *child)
 Get the initial size of a pane in px.
void ewl_paned_initial_size_set (Ewl_Paned *p, Ewl_Widget *child, int size)
 Set the initial size of a pane in px.
Ewl_Widgetewl_paned_new (void)
 Allocate and initialize a new paned widget.
Ewl_Orientation ewl_paned_orientation_get (Ewl_Paned *p)
 Get the orientation of the paned widget.
void ewl_paned_orientation_set (Ewl_Paned *p, Ewl_Orientation o)
 Set the orientation of the paned.
Ewl_Paned_Size_Infoewl_paned_size_info_add (Ewl_Paned *p, Ewl_Widget *w)
void ewl_paned_size_info_del (Ewl_Paned *p, Ewl_Widget *w)
Ewl_Paned_Size_Infoewl_paned_size_info_get (Ewl_Paned *p, Ewl_Widget *w)
Ewl_Widgetewl_vpaned_new (void)
 Allocate and initialize a new paned widget with vertical orientation.

Define Documentation

#define EWL_PANED_GRABBER (  )     ((Ewl_Paned_Grabber *)g)

#define EWL_PANED_GRABBER_IS (  )     (ewl_widget_type_is(EWL_WIDGET(w), EWL_PANED_GRABBER_TYPE))

Returns TRUE if the widget is an Ewl_Paned_Grabber, FALSE otherwise

Referenced by ewl_paned_cb_child_add(), ewl_paned_cb_child_remove(), and ewl_paned_orientation_set().

#define EWL_PANED_GRABBER_TYPE   "paned_grabber"

#define EWL_PANED_IS (  )     (ewl_widget_type_is(EWL_WIDGET(w), EWL_PANED_TYPE))

Returns TRUE if the widget is an Ewl_Paned, FALSE otherwise


Typedef Documentation

typedef struct Ewl_Paned Ewl_Paned

The Ewl_Paned widget

Typedef for the Ewl_Paned_Grabber struct

Widget Theme Keys:
/paned/file
Widget Theme Keys:
/paned/group
Widget Theme Keys:
/grabber/vertical/file
Widget Theme Keys:
/grabber/vertical/group
Widget Theme Keys:
/grabber/horizontal/file
Widget Theme Keys:
/grabber/horizontal/group
The Ewl_Paned_Size_Info structure


Function Documentation

Ewl_Widget* ewl_hpaned_new ( void   ) 

Allocate and initialize a new paned widget with horizontal orientation.

Returns:
Returns NULL on failure, or a pointer to a new paned widget on success.

References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, and ewl_paned_new().

Referenced by ewl_tree_init().

void ewl_paned_arrange ( Ewl_Paned p,
int  pane_num 
)

The arrange the child widgets.

Parameters:
w,: The paned to work with
pane_num,: The number of visible panes
Returns:
Returns no value This function is not to be intended to be used, if the widget is visible. Its purpose is to calculate the new position of the children even if the widget is hidden. This is useful if the paned serves as a size giver for a row, like in it is done in the tree widget. Use this function only if you know what you are doing.

References alloca(), CURRENT_H, CURRENT_W, CURRENT_X, CURRENT_Y, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_CONTAINER, EWL_ORIENTATION_HORIZONTAL, ewl_paned_orientation_get(), EWL_PANED_TYPE, EWL_WIDGET, last_pos, last_size, and new_panes.

Referenced by ewl_paned_cb_configure(), and ewl_tree_cb_configure().

void ewl_paned_cb_destroy ( Ewl_Widget w,
void *  ev,
void *  data 
)

unsigned int ewl_paned_fixed_size_get ( Ewl_Paned p,
Ewl_Widget child 
)

Retrieves if the pane is set to keep its size while resizing.

Parameters:
p,: The paned to work with
child,: The child widget to get the fixed size flag
Returns:
Returns if the pane is set to keep its size while resizing

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_paned_size_info_get(), EWL_PANED_TYPE, and Ewl_Paned_Size_Info::fixed.

Referenced by ewl_tree_column_fixed_size_get().

void ewl_paned_fixed_size_set ( Ewl_Paned p,
Ewl_Widget child,
unsigned int  fixed 
)

Set the given widget to resize only by the grabber.

Parameters:
p,: The paned to work with
child,: The child widget to set the fixed size flag
fixed,: the fixed size flag
Returns:
Returns no value.

References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_paned_size_info_add(), EWL_PANED_TYPE, and Ewl_Paned_Size_Info::fixed.

Referenced by ewl_tree_column_fixed_size_set().

int ewl_paned_initial_size_get ( Ewl_Paned p,
Ewl_Widget child 
)

Get the initial size of a pane in px.

Parameters:
p,: The paned to work with
child,: The child widget to get the initial size
Returns:
Returns the initial size that is set to the given widget. If there isn't any size set, it'll return 0.

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_paned_size_info_get(), EWL_PANED_TYPE, Ewl_Paned_Size_Info::initial_size, and Ewl_Paned_Size_Info::initial_size_has.

Referenced by ewl_tree_column_initial_size_get().

void ewl_paned_initial_size_set ( Ewl_Paned p,
Ewl_Widget child,
int  size 
)

Set the initial size of a pane in px.

Parameters:
p,: The paned to work with
child,: The child widget to set the initial size
size,: the size to set
Returns:
Returns no value.

References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_paned_size_info_add(), EWL_PANED_TYPE, Ewl_Paned_Size_Info::initial_size, and Ewl_Paned_Size_Info::initial_size_has.

Referenced by ewl_tree_column_initial_size_set().

Ewl_Widget* ewl_paned_new ( void   ) 

Allocate and initialize a new paned widget.

Returns:
Returns NULL on failure, or a pointer to a new paned widget on success.

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

Referenced by ewl_hpaned_new(), and ewl_vpaned_new().

Ewl_Orientation ewl_paned_orientation_get ( Ewl_Paned p  ) 

Get the orientation of the paned widget.

Parameters:
p,: The Ewl_Paned to get the orientation from
Returns:
Returns the Ewl_Orientation currently set on the paned

References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_ORIENTATION_HORIZONTAL, EWL_PANED_TYPE, and orientation.

Referenced by ewl_paned_arrange(), and ewl_paned_cb_child_add().

void ewl_paned_orientation_set ( Ewl_Paned p,
Ewl_Orientation  o 
)

Set the orientation of the paned.

Parameters:
p,: The paned to set the orientation on
o,: The Ewl_Orientation to set
Returns:
Returns no value.

References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_CONTAINER, EWL_PANED_GRABBER, EWL_PANED_GRABBER_IS, ewl_paned_grabber_paned_orientation_set(), EWL_PANED_TYPE, and orientation.

Referenced by ewl_vpaned_new().

Ewl_Widget* ewl_vpaned_new ( void   ) 

Allocate and initialize a new paned widget with vertical orientation.

Returns:
Returns NULL on failure, or a pointer to a new paned widget on success.

References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ORIENTATION_VERTICAL, EWL_PANED, ewl_paned_new(), and ewl_paned_orientation_set().


Copyright © Enlightenment.org

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