Ewl_Radiobutton: A Radio Button Widget and Grouping System
Detailed Description
Provides for a simple radiobutton with label, and to group radio buttons for selecting a single option.
- Remarks:
- Inherits from Ewl_Checkbutton.
Data Structures | |
| struct | Ewl_Radiobutton |
| Inherits from Ewl_Checkbutton and extends it to provide grouping buttons to limit to a single selection in a group at a given time. More... | |
Defines | |
| #define | EWL_RADIOBUTTON(button) ((Ewl_Radiobutton *) button) |
| #define | ewl_radiobutton_checked_set(r, c) ewl_checkbutton_checked_set(EWL_CHECKBUTTON(r), c) |
| #define | EWL_RADIOBUTTON_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_RADIOBUTTON_TYPE)) |
| #define | ewl_radiobutton_is_checked(r) ewl_checkbutton_is_checked(EWL_CHECKBUTTON(r)) |
| #define | EWL_RADIOBUTTON_TYPE "radiobutton" |
Typedefs | |
| typedef struct Ewl_Radiobutton | Ewl_Radiobutton |
Functions | |
| void | ewl_radiobutton_cb_clicked (Ewl_Widget *w, void *ev_data, void *user_data) |
| void | ewl_radiobutton_cb_destroy (Ewl_Widget *w, void *ev_data, void *user_data) |
| Ewl_Radiobutton * | ewl_radiobutton_chain_selected_get (Ewl_Radiobutton *rb) |
| void | ewl_radiobutton_chain_set (Ewl_Radiobutton *rb, Ewl_Radiobutton *crb) |
| Attach the button to a chain of radio buttons. | |
| int | ewl_radiobutton_init (Ewl_Radiobutton *rb) |
| Initialize the radio button fields and callbacks. | |
| Ewl_Widget * | ewl_radiobutton_new (void) |
| Allocate and initialize a new radio button. | |
| void * | ewl_radiobutton_value_get (Ewl_Radiobutton *rb) |
| void | ewl_radiobutton_value_set (Ewl_Radiobutton *rb, void *v) |
Define Documentation
| #define EWL_RADIOBUTTON | ( | button | ) | ((Ewl_Radiobutton *) button) |
Typecasts a pointer to an Ewl_Radiobutton pointer.
Referenced by ewl_colorpicker_init(), ewl_radiobutton_cb_clicked(), and ewl_radiobutton_cb_destroy().
| #define ewl_radiobutton_checked_set | ( | r, | |||
| c | ) | ewl_checkbutton_checked_set(EWL_CHECKBUTTON(r), c) |
Shortcut for setting the checked status on the inherited Ewl_Checkbutton fields.
| #define EWL_RADIOBUTTON_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_RADIOBUTTON_TYPE)) |
Returns TRUE if the widget is an Ewl_Radiobutton, FALSE otherwise
| #define ewl_radiobutton_is_checked | ( | r | ) | ewl_checkbutton_is_checked(EWL_CHECKBUTTON(r)) |
Shortcut for checking the checked status on the inherited Ewl_Checkbutton fields.
| #define EWL_RADIOBUTTON_TYPE "radiobutton" |
- Widget Theme Keys:
- /radiobutton/file
- Widget Theme Keys:
- /radiobutton/group
Referenced by ewl_radiobutton_cb_clicked(), ewl_radiobutton_cb_destroy(), ewl_radiobutton_chain_selected_get(), ewl_radiobutton_chain_set(), ewl_radiobutton_init(), ewl_radiobutton_value_get(), and ewl_radiobutton_value_set().
Typedef Documentation
| typedef struct Ewl_Radiobutton Ewl_Radiobutton |
The radio button provides a means for selecting a single item from a group of options.
Function Documentation
| void ewl_radiobutton_cb_clicked | ( | Ewl_Widget * | w, | |
| void * | ev_data, | |||
| void * | user_data | |||
| ) |
| void ewl_radiobutton_cb_destroy | ( | Ewl_Widget * | w, | |
| void * | ev_data, | |||
| void * | user_data | |||
| ) |
| Ewl_Radiobutton* ewl_radiobutton_chain_selected_get | ( | Ewl_Radiobutton * | rb | ) |
| void ewl_radiobutton_chain_set | ( | Ewl_Radiobutton * | rb, | |
| Ewl_Radiobutton * | crb | |||
| ) |
Attach the button to a chain of radio buttons.
- Parameters:
-
rb,: the radio button to be added to a chain of radio buttons crb,: a radio button already in the chain of radio buttons
- Returns:
- Returns no value. Associates w with the same chain as c, in order to ensure that only one radio button of that group is checked at any time.
References chain, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, and EWL_RADIOBUTTON_TYPE.
Referenced by ewl_colorpicker_init().
| int ewl_radiobutton_init | ( | Ewl_Radiobutton * | rb | ) |
Initialize the radio button fields and callbacks.
- Parameters:
-
rb,: the radio button to initialize
- Returns:
- Returns no value. Sets internal fields of the radio button to default values and sets the label to the specified label.
References Ewl_Checkbutton::check, DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_callback_append(), EWL_CALLBACK_CLICKED, EWL_CALLBACK_DESTROY, ewl_callback_prepend(), EWL_CHECKBUTTON, ewl_checkbutton_init(), ewl_radiobutton_cb_clicked(), ewl_radiobutton_cb_destroy(), EWL_RADIOBUTTON_TYPE, EWL_WIDGET, ewl_widget_appearance_set(), and ewl_widget_inherit().
Referenced by ewl_radiobutton_new().
| Ewl_Widget* ewl_radiobutton_new | ( | void | ) |
Allocate and initialize a new radio button.
- Returns:
- Returns a pointer to new radio button on success, NULL on failure.
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_radiobutton_init(), EWL_WIDGET, ewl_widget_destroy(), and NEW.
| void* ewl_radiobutton_value_get | ( | Ewl_Radiobutton * | rb | ) |
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_RADIOBUTTON_TYPE, and value.
| void ewl_radiobutton_value_set | ( | Ewl_Radiobutton * | rb, | |
| void * | v | |||
| ) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RADIOBUTTON_TYPE, and value.