Radio is a widget that allows for 1 or more options to be displayed and have the user choose only 1 of them. More...
Functions | |
void | elm_radio_state_value_set (Efl_Ui_Radio *obj, int value) |
Set the integer value that this radio object represents. More... | |
int | elm_radio_state_value_get (const Efl_Ui_Radio *obj) |
Get the integer value that this radio object represents. More... | |
void | elm_radio_value_pointer_set (Efl_Ui_Radio *obj, int *valuep) |
Set a convenience pointer to an integer, which changes when radio group value changes. More... | |
Efl_Canvas_Object * | elm_radio_selected_object_get (const Efl_Ui_Radio *obj) |
Get the selected radio object. More... | |
void | elm_radio_group_add (Efl_Ui_Radio *obj, Efl_Ui_Radio *group) |
Add this radio to a group of other radio objects. More... | |
Evas_Object * | elm_radio_add (Evas_Object *parent) |
Add a new radio to the parent. More... | |
void | elm_radio_value_set (Evas_Object *obj, int value) |
Set the value of the radio group. More... | |
int | elm_radio_value_get (const Evas_Object *obj) |
Get the value of the radio group. More... | |
Radio is a widget that allows for 1 or more options to be displayed and have the user choose only 1 of them.
A radio object contains an indicator, an optional Label and an optional icon object. While it's possible to have a group of only one radio they, are normally used in groups of 2 or more.
elm_radio objects are grouped in a slightly different, compared to other UI toolkits. There is no separate group name/id to remember or manage. The members represent the group, there are the group. To make a group, use elm_radio_group_add() and pass existing radio object and the new radio object.
The radio object(s) will select from one of a set of integer values, so any value they are configuring needs to be mapped to a set of integers. To configure what value that radio object represents, use elm_radio_state_value_set() to set the integer it represents. To set the value the whole group(which one is currently selected) is to indicate use elm_radio_value_set() on any group member, and to get the groups value use elm_radio_value_get(). For convenience the radio objects are also able to directly set an integer(int) to the value that is selected. To specify the pointer to this integer to modify, use elm_radio_value_pointer_set(). The radio objects will modify this directly. That implies the pointer must point to valid memory for as long as the radio objects exist.
This widget inherits from the Layout one, so that all the functions acting on it also work for radio objects.
This widget emits the following signals, besides the ones sent from Layout :
"changed"
- This is called when the radio object is selected. If you want to trace the state change of a radio group, you should add this callback to all the radio objects in that group. "focused"
- When the radio has received focus. (since 1.8) "unfocused"
- When the radio has lost focus. (since 1.8) "language,changed"
- the program's language changed (since 1.9)Default content parts of the radio widget that you can use for are:
Default text parts of the radio widget that you can use for are:
Supported elm_object common APIs.
Radio example show most of this API in action.
void elm_radio_state_value_set | ( | Efl_Ui_Radio * | obj, |
int | value | ||
) |
Set the integer value that this radio object represents.
This sets the value of the radio.
[in] | obj | The object. |
[in] | value | The value to use if this radio object is selected. |
int elm_radio_state_value_get | ( | const Efl_Ui_Radio * | obj | ) |
Get the integer value that this radio object represents.
This gets the value of the radio.
[in] | obj | The object. |
void elm_radio_value_pointer_set | ( | Efl_Ui_Radio * | obj, |
int * | valuep | ||
) |
Set a convenience pointer to an integer, which changes when radio group value changes.
This sets a pointer to an integer that in addition to the radio object state will also be modified directly. To stop setting the object pointed to, simply use NULL as the valuep argument. If valuep is not NULL then when called, the radio object state will also be modified to reflect the value of the integer valuep points to, just like calling elm_radio_value_set().
[in] | obj | The object. |
[in] | valuep | Pointer to the integer to modify |
References EINA_FALSE, and EINA_SAFETY_ON_FALSE_RETURN.
Efl_Canvas_Object * elm_radio_selected_object_get | ( | const Efl_Ui_Radio * | obj | ) |
Get the selected radio object.
[in] | obj | The object. |
References EINA_LIST_FOREACH, and EINA_SAFETY_ON_FALSE_RETURN_VAL.
void elm_radio_group_add | ( | Efl_Ui_Radio * | obj, |
Efl_Ui_Radio * | group | ||
) |
Add this radio to a group of other radio objects.
Radio objects work in groups. Each member should have a different integer value assigned. In order to have them work as a group, they need to know about each other. This adds the given radio object to the group of which the group object indicated is a member.
[in] | obj | The object. |
[in] | group | Any radio object whose group the obj is to join. |
References EINA_FALSE, eina_list_append(), eina_list_count(), eina_list_remove(), EINA_SAFETY_ON_FALSE_RETURN, and EINA_TRUE.
Evas_Object * elm_radio_add | ( | Evas_Object * | parent | ) |
Add a new radio to the parent.
parent | The parent object |
References EINA_SAFETY_ON_NULL_RETURN_VAL.
void elm_radio_value_set | ( | Evas_Object * | obj, |
int | value | ||
) |
Set the value of the radio group.
This sets the value of the radio group and will also set the value if pointed to, to the value supplied, but will not call any callbacks.
[in] | value | The value to use for the group |
References EINA_FALSE, and EINA_SAFETY_ON_FALSE_RETURN.
int elm_radio_value_get | ( | const Evas_Object * | obj | ) |
Get the value of the radio group.
References EINA_SAFETY_ON_FALSE_RETURN_VAL.