Ewl_Checkbutton: An Ewl_Checkbutton with Label
Detailed Description
Defines an Ewl_Checkbutton that inherits from Ewl_Widget and provides an Ewl_Check that changes value on each click.
- Remarks:
- Inherits from Ewl_Button.
Data Structures | |
struct | Ewl_Checkbutton |
Inherits from Ewl_Button and expands to provide a stateful check button. More... | |
Defines | |
#define | EWL_CHECKBUTTON(button) ((Ewl_Checkbutton *) button) |
#define | EWL_CHECKBUTTON_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_CHECKBUTTON_TYPE)) |
#define | EWL_CHECKBUTTON_TYPE "checkbutton" |
Typedefs | |
typedef struct Ewl_Checkbutton | Ewl_Checkbutton |
Functions | |
void | ewl_checkbutton_cb_clicked (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_checkbutton_checked_set (Ewl_Checkbutton *cb, int checked) |
Update the checked state of the check button. | |
int | ewl_checkbutton_init (Ewl_Checkbutton *cb) |
Initialize the members and callbacks of a check button. | |
int | ewl_checkbutton_is_checked (Ewl_Checkbutton *cb) |
Retrieve the checked state of a check button. | |
void | ewl_checkbutton_label_position_set (Ewl_Checkbutton *cb, Ewl_Position p) |
Set the check buttons label position. | |
Ewl_Widget * | ewl_checkbutton_new (void) |
Allocate and initialize a new check button. | |
Ewl_View * | ewl_checkbutton_view_get (void) |
Creates and returns a view to be used by Ewl_Checkbutton widgets. |
Define Documentation
#define EWL_CHECKBUTTON | ( | button | ) | ((Ewl_Checkbutton *) button) |
Typecasts a pointer to an Ewl_Checkbutton pointer.
Referenced by ewl_checkbutton_cb_clicked(), ewl_checkbutton_checked_set(), ewl_checkbutton_is_checked(), ewl_colorpicker_init(), ewl_radiobutton_cb_clicked(), ewl_radiobutton_chain_selected_get(), and ewl_radiobutton_init().
#define EWL_CHECKBUTTON_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_CHECKBUTTON_TYPE)) |
Returns TRUE if the widget is an Ewl_Checkbutton, FALSE otherwise
#define EWL_CHECKBUTTON_TYPE "checkbutton" |
- Widget Theme Keys:
- /checkbutton/file
- Widget Theme Keys:
- /checkbutton/group
Referenced by ewl_checkbutton_cb_clicked(), ewl_checkbutton_checked_set(), ewl_checkbutton_init(), ewl_checkbutton_is_checked(), and ewl_checkbutton_label_position_set().
Typedef Documentation
typedef struct Ewl_Checkbutton Ewl_Checkbutton |
The button class is a basic button with a label. This class is inherited by the check button and radio button classes.
Function Documentation
void ewl_checkbutton_cb_clicked | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
void ewl_checkbutton_checked_set | ( | Ewl_Checkbutton * | cb, | |
int | c | |||
) |
Update the checked state of the check button.
- Parameters:
-
cb,: The checkbutton to set the checked value of c,: The checked value to set
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_CHECK, ewl_check_checked_set(), EWL_CHECKBUTTON, and EWL_CHECKBUTTON_TYPE.
Referenced by ewl_colorpicker_init(), and ewl_radiobutton_cb_clicked().
int ewl_checkbutton_init | ( | Ewl_Checkbutton * | cb | ) |
Initialize the members and callbacks of a check button.
- Parameters:
-
cb,: the check button to initialize
- Returns:
- Returns no value. The internal structures and callbacks of the checkbutton are initialized to default values.
References check, DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BUTTON, ewl_button_init(), ewl_callback_append(), EWL_CALLBACK_CLICKED, ewl_callback_del(), ewl_check_cb_clicked(), ewl_check_new(), ewl_checkbutton_cb_clicked(), EWL_CHECKBUTTON_TYPE, EWL_CONTAINER, ewl_container_child_prepend(), EWL_FLAG_ALIGN_LEFT, EWL_FLAG_FILL_NONE, EWL_OBJECT, ewl_object_alignment_set(), ewl_object_fill_policy_set(), EWL_POSITION_RIGHT, EWL_WIDGET, ewl_widget_appearance_set(), ewl_widget_inherit(), ewl_widget_internal_set(), ewl_widget_show(), and label_position.
Referenced by ewl_checkbutton_new(), and ewl_radiobutton_init().
int ewl_checkbutton_is_checked | ( | Ewl_Checkbutton * | cb | ) |
Retrieve the checked state of a check button.
- Parameters:
-
cb,: The checkbutton to work with
- Returns:
- Returns TRUE if the checkbutton is set, FALSE otherwise
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_CHECK, ewl_check_is_checked(), EWL_CHECKBUTTON, and EWL_CHECKBUTTON_TYPE.
Referenced by ewl_radiobutton_cb_clicked(), and ewl_radiobutton_chain_selected_get().
void ewl_checkbutton_label_position_set | ( | Ewl_Checkbutton * | cb, | |
Ewl_Position | p | |||
) |
Set the check buttons label position.
- Parameters:
-
cb,: the widget to change the label positioning p,: the new position of the label
- Returns:
- Returns no value. Changes the position of the label associated with the check button.
References check, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_BUTTON, EWL_CHECKBUTTON_TYPE, EWL_CONTAINER, ewl_container_child_append(), ewl_container_child_remove(), EWL_POSITION_RIGHT, EWL_WIDGET, ewl_widget_configure(), Ewl_Button::label_object, and label_position.
Ewl_Widget* ewl_checkbutton_new | ( | void | ) |
Allocate and initialize a new check button.
- Returns:
- Returns the newly allocated checkbutton on success, NULL on failure.
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_checkbutton_init(), EWL_WIDGET, ewl_widget_destroy(), and NEW.
Ewl_View* ewl_checkbutton_view_get | ( | void | ) |
Creates and returns a view to be used by Ewl_Checkbutton widgets.
- Returns:
- Returns a view that can be used to display Ewl_Checkbutton widgets
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_view_header_fetch_set(), ewl_view_new(), and ewl_view_widget_fetch_set().