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:
ewl_container_child_append(EWL_CONTAINER(paned), child); ewl_paned_initial_size_set(EWL_PANED(paned), child, 100);
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_Widget * | ewl_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_Widget * | ewl_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_Widget * | ewl_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_Info * | ewl_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_Info * | ewl_paned_size_info_get (Ewl_Paned *p, Ewl_Widget *w) |
Ewl_Widget * | ewl_vpaned_new (void) |
Allocate and initialize a new paned widget with vertical orientation. |
Define Documentation
#define EWL_PANED | ( | paned | ) | ((Ewl_Paned *) paned) |
Typecasts a pointer to a Ewl_Paned pointer
Referenced by ewl_paned_cb_child_add(), ewl_paned_cb_child_hide(), ewl_paned_cb_child_remove(), ewl_paned_cb_child_resize(), ewl_paned_cb_child_show(), ewl_paned_cb_configure(), ewl_paned_cb_destroy(), ewl_tree_cb_configure(), ewl_tree_column_fixed_size_get(), ewl_tree_column_fixed_size_set(), ewl_tree_column_initial_size_get(), ewl_tree_column_initial_size_set(), and ewl_vpaned_new().
#define EWL_PANED_GRABBER | ( | g | ) | ((Ewl_Paned_Grabber *)g) |
Typecasts a pointer to an Ewl_Paned_Grabber pointer
Referenced by ewl_paned_cb_child_add(), ewl_paned_grabber_new(), and ewl_paned_orientation_set().
#define EWL_PANED_GRABBER_IS | ( | w | ) | (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" |
The type name for the Ewl_Paned_Grabber widget
Referenced by ewl_paned_grabber_init(), ewl_paned_grabber_orientation_get(), ewl_paned_grabber_paned_orientation_set(), and ewl_paned_grabber_show_cursor_for().
#define EWL_PANED_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_PANED_TYPE)) |
Returns TRUE if the widget is an Ewl_Paned, FALSE otherwise
#define EWL_PANED_TYPE "paned" |
The type name for the Ewl_Paned widget
Referenced by ewl_paned_arrange(), ewl_paned_cb_child_add(), ewl_paned_cb_child_hide(), ewl_paned_cb_child_remove(), ewl_paned_cb_child_resize(), ewl_paned_cb_child_show(), ewl_paned_cb_configure(), ewl_paned_cb_destroy(), ewl_paned_fixed_size_get(), ewl_paned_fixed_size_set(), ewl_paned_init(), ewl_paned_initial_size_get(), ewl_paned_initial_size_set(), ewl_paned_orientation_get(), ewl_paned_orientation_set(), ewl_paned_size_info_add(), ewl_paned_size_info_del(), and ewl_paned_size_info_get().
Typedef Documentation
typedef struct Ewl_Paned_Grabber Ewl_Paned_Grabber |
Typedef for the Ewl_Paned_Grabber struct
typedef struct Ewl_Paned_Size_Info Ewl_Paned_Size_Info |
- 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
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_child_add | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, ewl_container_child_index_get(), ewl_container_child_insert(), EWL_PANED, EWL_PANED_GRABBER, EWL_PANED_GRABBER_IS, ewl_paned_grabber_new(), ewl_paned_grabber_paned_orientation_set(), ewl_paned_orientation_get(), EWL_PANED_TYPE, and EWL_WIDGET_TYPE.
Referenced by ewl_paned_init().
void ewl_paned_cb_child_hide | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_OBJECT, ewl_object_preferred_inner_size_get(), ewl_object_preferred_inner_size_set(), ewl_object_preferred_size_get(), EWL_ORIENTATION_HORIZONTAL, EWL_PANED, ewl_paned_size_info_get(), EWL_PANED_TYPE, EWL_WIDGET_TYPE, Ewl_Paned_Size_Info::initial_size, and Ewl_Paned_Size_Info::initial_size_has.
Referenced by ewl_paned_init().
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 | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_container_largest_prefer(), EWL_OBJECT, ewl_object_preferred_inner_h_set(), ewl_object_preferred_inner_w_set(), EWL_ORIENTATION_HORIZONTAL, EWL_PANED, ewl_paned_size_info_get(), EWL_PANED_TYPE, EWL_WIDGET_TYPE, Ewl_Paned_Size_Info::initial_size_has, PREFERRED_H, and PREFERRED_W.
Referenced by ewl_paned_init().
void ewl_paned_cb_child_show | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_OBJECT, ewl_object_preferred_inner_size_get(), ewl_object_preferred_inner_size_set(), ewl_object_preferred_size_get(), EWL_ORIENTATION_HORIZONTAL, EWL_PANED, ewl_paned_size_info_get(), EWL_PANED_TYPE, EWL_WIDGET_TYPE, Ewl_Paned_Size_Info::initial_size, and Ewl_Paned_Size_Info::initial_size_has.
Referenced by ewl_paned_init().
void ewl_paned_cb_configure | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CONTAINER, ewl_container_child_count_visible_get(), EWL_PANED, ewl_paned_arrange(), and EWL_PANED_TYPE.
Referenced by ewl_paned_init().
void ewl_paned_cb_destroy | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_PANED, EWL_PANED_TYPE, IF_FREE, and info.
Referenced by ewl_paned_init().
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_grabber_init | ( | Ewl_Paned_Grabber * | g | ) |
References DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_callback_append(), EWL_CALLBACK_MOUSE_DOWN, EWL_CALLBACK_MOUSE_UP, EWL_ORIENTATION_VERTICAL, ewl_paned_grabber_paned_orientation_set(), EWL_PANED_GRABBER_TYPE, EWL_SEPARATOR, ewl_separator_init(), EWL_WIDGET, ewl_widget_inherit(), and ewl_widget_internal_set().
Referenced by ewl_paned_grabber_new().
Ewl_Widget* ewl_paned_grabber_new | ( | void | ) |
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_PANED_GRABBER, ewl_paned_grabber_init(), ewl_widget_destroy(), and NEW.
Referenced by ewl_paned_cb_child_add().
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 | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_ORIENTATION_HORIZONTAL, EWL_ORIENTATION_VERTICAL, ewl_paned_grabber_show_cursor_for(), EWL_PANED_GRABBER_TYPE, EWL_POSITION_BOTTOM, EWL_POSITION_LEFT, EWL_POSITION_RIGHT, EWL_POSITION_TOP, EWL_SEPARATOR, ewl_separator_orientation_set(), EWL_WIDGET, and ewl_widget_appearance_set().
Referenced by ewl_paned_cb_child_add(), ewl_paned_grabber_init(), and ewl_paned_orientation_set().
void ewl_paned_grabber_show_cursor_for | ( | Ewl_Paned_Grabber * | g, | |
unsigned int | dir | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_attach_mouse_cursor_set, EWL_MOUSE_CURSOR_SB_DOWN_ARROW, EWL_MOUSE_CURSOR_SB_H_DOUBLE_ARROW, EWL_MOUSE_CURSOR_SB_LEFT_ARROW, EWL_MOUSE_CURSOR_SB_RIGHT_ARROW, EWL_MOUSE_CURSOR_SB_UP_ARROW, EWL_MOUSE_CURSOR_SB_V_DOUBLE_ARROW, EWL_PANED_GRABBER_TYPE, EWL_POSITION_BOTTOM, EWL_POSITION_LEFT, EWL_POSITION_RIGHT, EWL_POSITION_TOP, and EWL_WIDGET.
Referenced by ewl_paned_grabber_paned_orientation_set().
int ewl_paned_init | ( | Ewl_Paned * | p | ) |
Initialize a new paned widget to default values.
- Parameters:
-
p,: the paned widget to initialize
- Returns:
- Returns 1 on success or 0 on failure
References DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_callback_append(), EWL_CALLBACK_CONFIGURE, EWL_CALLBACK_DESTROY, EWL_CONTAINER, ewl_container_add_notify_set(), ewl_container_hide_notify_set(), ewl_container_init(), ewl_container_remove_notify_set(), ewl_container_resize_notify_set(), ewl_container_show_notify_set(), EWL_FLAG_ALIGN_LEFT, EWL_FLAG_ALIGN_TOP, EWL_FLAG_FILL_FILL, EWL_OBJECT, ewl_object_alignment_set(), ewl_object_fill_policy_set(), EWL_ORIENTATION_HORIZONTAL, ewl_paned_cb_child_add(), ewl_paned_cb_child_hide(), ewl_paned_cb_child_remove(), ewl_paned_cb_child_resize(), ewl_paned_cb_child_show(), ewl_paned_cb_configure(), ewl_paned_cb_destroy(), EWL_PANED_TYPE, EWL_WIDGET, ewl_widget_appearance_set(), ewl_widget_focusable_set(), ewl_widget_inherit(), new_panes, and orientation.
Referenced by ewl_paned_new().
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_Paned_Size_Info* ewl_paned_size_info_add | ( | Ewl_Paned * | p, | |
Ewl_Widget * | w | |||
) |
References Ewl_Paned_Size_Info::child, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_paned_size_info_get(), EWL_PANED_TYPE, info, and info_size.
Referenced by ewl_paned_fixed_size_set(), and ewl_paned_initial_size_set().
void ewl_paned_size_info_del | ( | Ewl_Paned * | p, | |
Ewl_Widget * | w | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, ewl_paned_size_info_get(), EWL_PANED_TYPE, info, and info_size.
Referenced by ewl_paned_cb_child_remove().
Ewl_Paned_Size_Info* ewl_paned_size_info_get | ( | Ewl_Paned * | p, | |
Ewl_Widget * | w | |||
) |
References Ewl_Paned_Size_Info::child, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_PANED_TYPE, info, and info_size.
Referenced by ewl_paned_cb_child_hide(), ewl_paned_cb_child_resize(), ewl_paned_cb_child_show(), ewl_paned_fixed_size_get(), ewl_paned_initial_size_get(), ewl_paned_size_info_add(), and ewl_paned_size_info_del().
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().