Ewl_Notebook: A notebook widget
Detailed Description
Defines a class for notebook layout
- Remarks:
- Inherits from Ewl_Box.
Tutorial
Data Structures | |
struct | Ewl_Notebook |
Inherits from Ewl_Box and extends to provide for a notebook style layout. More... | |
Defines | |
#define | EWL_NOTEBOOK(n) ((Ewl_Notebook *)n) |
#define | EWL_NOTEBOOK_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_NOTEBOOK_TYPE)) |
#define | EWL_NOTEBOOK_TYPE "notebook" |
Typedefs | |
typedef struct Ewl_Notebook | Ewl_Notebook |
Functions | |
void | ewl_notebook_cb_child_add (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_notebook_cb_child_hide (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_notebook_cb_child_remove (Ewl_Container *c, Ewl_Widget *w, int rem_idx) |
void | ewl_notebook_cb_child_show (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_notebook_cb_tab_clicked (Ewl_Widget *w, void *ev, void *data) |
int | ewl_notebook_init (Ewl_Notebook *n) |
Initialize a notebook to default values and callbacks. | |
Ewl_Widget * | ewl_notebook_new (void) |
Create a new notebook widget. | |
const char * | ewl_notebook_page_tab_text_get (Ewl_Notebook *n, Ewl_Widget *page) |
Get the text of the notebook page page . | |
void | ewl_notebook_page_tab_text_set (Ewl_Notebook *n, Ewl_Widget *page, const char *text) |
Set the text of the tab for the page page to the text text . | |
Ewl_Widget * | ewl_notebook_page_tab_widget_get (Ewl_Notebook *n, Ewl_Widget *page) |
Retrieve the widget used as the tab for the page page . | |
void | ewl_notebook_page_tab_widget_set (Ewl_Notebook *n, Ewl_Widget *page, Ewl_Widget *tab) |
Set the widget to use as the tab for the page page to widget tab . | |
unsigned int | ewl_notebook_tabbar_alignment_get (Ewl_Notebook *n) |
Retrieves the alignment of the tabbar in the notebook widget. | |
void | ewl_notebook_tabbar_alignment_set (Ewl_Notebook *n, unsigned int align) |
Set the alignment of the tabbar in the notebook widget. | |
unsigned int | ewl_notebook_tabbar_homogeneous_get (Ewl_Notebook *n) |
Retrieves the homogeneous value of the notebook. | |
void | ewl_notebook_tabbar_homogeneous_set (Ewl_Notebook *n, unsigned int h) |
Sets the tabs in the notebook to be the same size. | |
Ewl_Position | ewl_notebook_tabbar_position_get (Ewl_Notebook *n) |
Get the position of the tabbar in the notebook widget. | |
void | ewl_notebook_tabbar_position_set (Ewl_Notebook *n, Ewl_Position pos) |
Set the position of the tabbar in the notebook widget. | |
unsigned int | ewl_notebook_tabbar_visible_get (Ewl_Notebook *n) |
Retrieve if the tabbar is visible. | |
void | ewl_notebook_tabbar_visible_set (Ewl_Notebook *n, unsigned int visible) |
Set if the tabbar is visible. | |
Ewl_Widget * | ewl_notebook_visible_page_get (Ewl_Notebook *n) |
Get the current visible page of the notebook. | |
void | ewl_notebook_visible_page_set (Ewl_Notebook *n, Ewl_Widget *page) |
Set the current visible page of the notebook. |
Define Documentation
#define EWL_NOTEBOOK | ( | n | ) | ((Ewl_Notebook *)n) |
Typecasts a pointer to an Ewl_Notebook pointer.
Referenced by ewl_notebook_cb_child_add(), ewl_notebook_cb_child_hide(), ewl_notebook_cb_child_remove(), ewl_notebook_cb_child_show(), and ewl_notebook_new().
#define EWL_NOTEBOOK_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_NOTEBOOK_TYPE)) |
Returns TRUE if the widget is an Ewl_Notebook, FALSE otherwise
#define EWL_NOTEBOOK_TYPE "notebook" |
- Widget Theme Keys:
- /notebook
- Widget Theme Keys:
- /notebook/tabbar
- Widget Theme Keys:
- /notebook/tabbar/
- Widget Theme Keys:
- /notebook/tabbar/tab
- Widget Theme Keys:
- /notebook/tabbar/tab/label
- Widget Theme Keys:
- /notebook/pages
Referenced by ewl_notebook_cb_tab_clicked(), ewl_notebook_init(), ewl_notebook_page_tab_text_get(), ewl_notebook_page_tab_text_set(), ewl_notebook_page_tab_widget_get(), ewl_notebook_page_tab_widget_set(), ewl_notebook_tabbar_alignment_get(), ewl_notebook_tabbar_alignment_set(), ewl_notebook_tabbar_homogeneous_get(), ewl_notebook_tabbar_homogeneous_set(), ewl_notebook_tabbar_position_get(), ewl_notebook_tabbar_visible_get(), ewl_notebook_tabbar_visible_set(), ewl_notebook_visible_page_get(), and ewl_notebook_visible_page_set().
Typedef Documentation
typedef struct Ewl_Notebook Ewl_Notebook |
Holds the notebook information
Function Documentation
void ewl_notebook_cb_child_add | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
void ewl_notebook_cb_child_hide | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
References cur_page, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CONTAINER_TYPE, EWL_NOTEBOOK, EWL_WIDGET, ewl_widget_show(), and EWL_WIDGET_TYPE.
Referenced by ewl_notebook_init().
void ewl_notebook_cb_child_remove | ( | Ewl_Container * | c, | |
Ewl_Widget * | w, | |||
int | rem_idx | |||
) |
References body, cur_page, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_attach_widget_association_get, EWL_CONTAINER, ewl_container_child_count_get(), ewl_container_child_get(), ewl_container_child_index_get(), EWL_CONTAINER_TYPE, EWL_NOTEBOOK, ewl_notebook_visible_page_set(), EWL_WIDGET, ewl_widget_destroy(), EWL_WIDGET_TYPE, and tabbar.
Referenced by ewl_notebook_init().
void ewl_notebook_cb_child_show | ( | Ewl_Container * | c, | |
Ewl_Widget * | w | |||
) |
References body, cur_page, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CONTAINER_TYPE, EWL_NOTEBOOK, EWL_OBJECT, ewl_object_preferred_inner_size_set(), ewl_object_preferred_size_get(), EWL_WIDGET, ewl_widget_hide(), EWL_WIDGET_TYPE, and pages.
Referenced by ewl_notebook_init().
void ewl_notebook_cb_tab_clicked | ( | Ewl_Widget * | w, | |
void * | ev, | |||
void * | data | |||
) |
int ewl_notebook_init | ( | Ewl_Notebook * | n | ) |
Initialize a notebook to default values and callbacks.
- Parameters:
-
n,: The Ewl_Notebook widget to initialize
- Returns:
- Returns TRUE on success or NULL on failure.
References body, DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BOX, ewl_box_init(), ewl_box_orientation_set(), EWL_CONTAINER, ewl_container_add_notify_set(), ewl_container_child_append(), ewl_container_hide_notify_set(), ewl_container_redirect_set(), ewl_container_remove_notify_set(), ewl_container_show_notify_set(), EWL_FLAG_ALIGN_CENTER, EWL_FLAG_FILL_ALL, EWL_FLAG_FILL_NONE, ewl_hbox_new(), ewl_notebook_cb_child_add(), ewl_notebook_cb_child_hide(), ewl_notebook_cb_child_remove(), ewl_notebook_cb_child_show(), EWL_NOTEBOOK_TYPE, EWL_OBJECT, ewl_object_alignment_set(), ewl_object_fill_policy_set(), EWL_ORIENTATION_VERTICAL, EWL_POSITION_TOP, ewl_vbox_new(), EWL_WIDGET, ewl_widget_appearance_set(), ewl_widget_inherit(), ewl_widget_internal_set(), ewl_widget_show(), pages, tabbar, and tabbar_position.
Referenced by ewl_notebook_new().
Ewl_Widget* ewl_notebook_new | ( | void | ) |
Create a new notebook widget.
- Returns:
- Returns a newly allocated notebook on success. NULL on failure
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_NOTEBOOK, ewl_notebook_init(), ewl_widget_destroy(), and NEW.
const char* ewl_notebook_page_tab_text_get | ( | Ewl_Notebook * | n, | |
Ewl_Widget * | page | |||
) |
Get the text of the notebook page page
.
- Parameters:
-
n,: The Ewl_Notebook to work with page,: The page to get the tab text from
- Returns:
- Returns the text of the pages tab
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_LABEL, ewl_label_text_get(), ewl_notebook_page_tab_widget_get(), EWL_NOTEBOOK_TYPE, and EWL_WIDGET_TYPE.
void ewl_notebook_page_tab_text_set | ( | Ewl_Notebook * | n, | |
Ewl_Widget * | page, | |||
const char * | text | |||
) |
Set the text of the tab for the page page
to the text text
.
- Parameters:
-
n,: The Ewl_Notebook to set the tab text in page,: The page to associate the tab text too text,: The text to set in the tab
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_LABEL, ewl_label_new(), ewl_label_text_set(), ewl_notebook_page_tab_widget_set(), EWL_NOTEBOOK_TYPE, ewl_widget_show(), and EWL_WIDGET_TYPE.
Ewl_Widget* ewl_notebook_page_tab_widget_get | ( | Ewl_Notebook * | n, | |
Ewl_Widget * | page | |||
) |
Retrieve the widget used as the tab for the page page
.
- Parameters:
-
n,: The Ewl_Notebook to get the tab widget from page,: The page to get the tab from
- Returns:
- Returns the tab widget associated with the given page
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, DWARNING, ewl_attach_widget_association_get, EWL_CONTAINER, ewl_container_child_get(), EWL_NOTEBOOK_TYPE, and EWL_WIDGET_TYPE.
Referenced by ewl_notebook_page_tab_text_get().
void ewl_notebook_page_tab_widget_set | ( | Ewl_Notebook * | n, | |
Ewl_Widget * | page, | |||
Ewl_Widget * | tab | |||
) |
Set the widget to use as the tab for the page page
to widget tab
.
- Parameters:
-
n,: The Ewl_Notebook to set the tab into page,: The page to associate the tab with tab,: The contents of the tab
- Returns:
- Returns no value.
References body, cur_page, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_attach_widget_association_get, ewl_attach_widget_association_set, ewl_callback_append(), EWL_CALLBACK_CLICKED, EWL_CONTAINER, ewl_container_child_append(), ewl_container_child_index_get(), ewl_container_child_insert(), ewl_hbox_new(), ewl_notebook_cb_tab_clicked(), EWL_NOTEBOOK_TYPE, EWL_STATE_PERSISTENT, ewl_widget_appearance_set(), ewl_widget_show(), ewl_widget_state_set(), EWL_WIDGET_TYPE, and tabbar.
Referenced by ewl_notebook_cb_child_add(), and ewl_notebook_page_tab_text_set().
unsigned int ewl_notebook_tabbar_alignment_get | ( | Ewl_Notebook * | n | ) |
Retrieves the alignment of the tabbar in the notebook widget.
- Parameters:
-
n,: The Ewl_Notebook to get the alignment from
- Returns:
- Returns the current alignment values of the widget
References body, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_NOTEBOOK_TYPE, EWL_OBJECT, ewl_object_alignment_get(), and tabbar.
void ewl_notebook_tabbar_alignment_set | ( | Ewl_Notebook * | n, | |
unsigned int | align | |||
) |
Set the alignment of the tabbar in the notebook widget.
- Parameters:
-
n,: The Ewl_Notebook to set the tabbar alignment of align,: The Ewl_Alignment to set the alignment too
- Returns:
- Returns no value.
References body, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_NOTEBOOK_TYPE, EWL_OBJECT, ewl_object_alignment_set(), and tabbar.
unsigned int ewl_notebook_tabbar_homogeneous_get | ( | Ewl_Notebook * | n | ) |
Retrieves the homogeneous value of the notebook.
- Parameters:
-
n,: The Ewl_Notebook to check for homogeneous
- Returns:
- Returns the homgeneous value of the notebook n
References body, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BOX, ewl_box_homogeneous_get(), EWL_NOTEBOOK_TYPE, and tabbar.
void ewl_notebook_tabbar_homogeneous_set | ( | Ewl_Notebook * | n, | |
unsigned int | h | |||
) |
Sets the tabs in the notebook to be the same size.
- Parameters:
-
n,: The Ewl_Notebook to make homogeneous h,: Boolean value to set the notebook's homogeneous value
- Returns:
- Returns no value
References body, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_BOX, ewl_box_homogeneous_set(), EWL_NOTEBOOK_TYPE, and tabbar.
Ewl_Position ewl_notebook_tabbar_position_get | ( | Ewl_Notebook * | n | ) |
Get the position of the tabbar in the notebook widget.
- Parameters:
-
n,: The Ewl_Notebook to get the tabbar position of
- Returns:
- Returns the current Ewl_Position of the tabbar
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_NOTEBOOK_TYPE, EWL_POSITION_TOP, and tabbar_position.
void ewl_notebook_tabbar_position_set | ( | Ewl_Notebook * | n, | |
Ewl_Position | pos | |||
) |
Set the position of the tabbar in the notebook widget.
- Parameters:
-
n,: The Ewl_Notebook to set the tabbar position of pos,: The Ewl_Position to put the tabbar in
- Returns:
- Returns no value.
References body, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_BOX, ewl_box_orientation_set(), EWL_CONTAINER, ewl_container_child_append(), ewl_container_child_prepend(), ewl_container_child_remove(), ewl_container_redirect_set(), EWL_OBJECT, ewl_object_preferred_h_get(), ewl_object_preferred_inner_size_set(), ewl_object_preferred_size_get(), ewl_object_preferred_w_get(), EWL_ORIENTATION_HORIZONTAL, EWL_ORIENTATION_VERTICAL, EWL_POSITION_BOTTOM, EWL_POSITION_LEFT, EWL_POSITION_RIGHT, EWL_POSITION_TOP, ewl_widget_appearance_set(), pages, tabbar, and tabbar_position.
unsigned int ewl_notebook_tabbar_visible_get | ( | Ewl_Notebook * | n | ) |
Retrieve if the tabbar is visible.
- Parameters:
-
n,: The Ewl_Notebook to get the tabbar visiblity of
- Returns:
- Returns the visibility of the tabbar
References body, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_NOTEBOOK_TYPE, tabbar, and VISIBLE.
void ewl_notebook_tabbar_visible_set | ( | Ewl_Notebook * | n, | |
unsigned int | visible | |||
) |
Set if the tabbar is visible.
- Parameters:
-
n,: The Ewl_Notebook to set the visible flag of the tabbar visible,: The flag to set for the tabbar visibility
- Returns:
- Returns no value.
References body, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_NOTEBOOK_TYPE, EWL_STATE_PERSISTENT, EWL_WIDGET, ewl_widget_hide(), ewl_widget_show(), ewl_widget_state_set(), pages, and tabbar.
Ewl_Widget* ewl_notebook_visible_page_get | ( | Ewl_Notebook * | n | ) |
Get the current visible page of the notebook.
- Parameters:
-
n,: The Ewl_Notebook to get the visible page of
- Returns:
- Returns the visible page of the notebook
References cur_page, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, and EWL_NOTEBOOK_TYPE.
void ewl_notebook_visible_page_set | ( | Ewl_Notebook * | n, | |
Ewl_Widget * | page | |||
) |
Set the current visible page of the notebook.
- Parameters:
-
n,: The Ewl_Notebook to set the visible page of page,: The page to set visible in the tabbar
- Returns:
- Returns no value.
References cur_page, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, ewl_attach_widget_association_get, ewl_callback_call(), EWL_CALLBACK_VALUE_CHANGED, EWL_NOTEBOOK_TYPE, EWL_STATE_PERSISTENT, EWL_WIDGET, ewl_widget_hide(), ewl_widget_show(), and ewl_widget_state_set().
Referenced by ewl_notebook_cb_child_add(), ewl_notebook_cb_child_remove(), and ewl_notebook_cb_tab_clicked().