- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Macros | Functions
Radio

Radio is a widget that allows for 1 or more options to be displayed and have the user choose only 1 of them. More...

## Macros
#define | elm_obj_radio_group_add(group) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_GROUP_ADD), EO_TYPECHECK(Evas_Object *, group)
| Add this radio to a group of other radio objects. More...
#define | elm_obj_radio_state_value_set(value) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_SET), EO_TYPECHECK(int, value)
| Set the integer value that this radio object represents. More...
#define | elm_obj_radio_state_value_get(ret) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_GET), EO_TYPECHECK(int *, ret)
| Get the integer value that this radio object represents. More...
#define | elm_obj_radio_value_set(value) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_SET), EO_TYPECHECK(int, value)
| Set the value of the radio group. More...
#define | elm_obj_radio_value_get(ret) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_GET), EO_TYPECHECK(int *, ret)
| Get the value of the radio group. More...
#define | elm_obj_radio_value_pointer_set(valuep) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_POINTER_SET), EO_TYPECHECK(int *, valuep)
| Set a convenience pointer to a integer to change when radio group. More...
#define | elm_obj_radio_selected_object_get(ret) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_SELECTED_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret)
| Get the selected radio object. More...

## Functions
Evas_Object * | elm_radio_add (Evas_Object *parent)
| Add a new radio to the parent. More...
void | elm_radio_group_add (Evas_Object *obj, Evas_Object *group)
| Add this radio to a group of other radio objects. More...
void | elm_radio_state_value_set (Evas_Object *obj, int value)
| Set the integer value that this radio object represents. More...
int | elm_radio_state_value_get (const Evas_Object *obj)
| Get the integer value that this radio object represents. 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...
void | elm_radio_value_pointer_set (Evas_Object *obj, int *valuep)
| Set a convenience pointer to a integer to change when radio group value changes. More...
Evas_Object * | elm_radio_selected_object_get (Evas_Object *obj)
| Get the selected radio object. More...

## Detailed Description

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 seperate 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 whenever the user changes the state of one of the radio objects within the group of radio objects that work together.
- `"focused"` - When the radio has received focus. (since 1.8)
- `"unfocused"` - When the radio has lost focus. (since 1.8)

Default text parts of the radio widget that you can use for are:

- "default" - Label of the radio

Default content parts of the radio widget that you can use for are:

- "icon" - An icon of the radio

Supported elm_object common APIs.

- elm_object_part_text_set
- elm_object_part_text_get
- elm_object_part_content_set
- elm_object_part_content_get
- elm_object_part_content_unset
- elm_object_disabled_set
- elm_object_disabled_get

Radio example show most of this API in action.

## Macro Definition Documentation

#define elm_obj_radio_group_add | ( |  | group | ) | ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_GROUP_ADD), EO_TYPECHECK(Evas_Object *, group)

Add this radio to a group of other radio objects.

Since
  1.8

Parameters

  [in] | group |

See Also
  elm_radio_group_add

Referenced by elm_radio_group_add().

#define elm_obj_radio_selected_object_get | ( |  | ret | ) | ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_SELECTED_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret)

Get the selected radio object.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_radio_selected_object_get

Referenced by elm_radio_selected_object_get().

#define elm_obj_radio_state_value_get | ( |  | ret | ) | ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_GET), EO_TYPECHECK(int *, ret)

Get the integer value that this radio object represents.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_radio_state_value_get

Referenced by elm_radio_state_value_get().

#define elm_obj_radio_state_value_set | ( |  | value | ) | ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_SET), EO_TYPECHECK(int, value)

Set the integer value that this radio object represents.

Since
  1.8

Parameters

  [in] | value |

See Also
  elm_radio_state_value_set

Referenced by elm_radio_state_value_set().

#define elm_obj_radio_value_get | ( |  | ret | ) | ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_GET), EO_TYPECHECK(int *, ret)

Get the value of the radio group.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_radio_value_get

Referenced by elm_radio_value_get().

#define elm_obj_radio_value_pointer_set | ( |  | valuep | ) | ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_POINTER_SET), EO_TYPECHECK(int *, valuep)

Set a convenience pointer to a integer to change when radio group.

Since
  1.8

Parameters

  [in] | valuep |

See Also
  elm_radio_value_pointer_set

Referenced by elm_radio_value_pointer_set().

#define elm_obj_radio_value_set | ( |  | value | ) | ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_SET), EO_TYPECHECK(int, value)

Set the value of the radio group.

Since
  1.8

Parameters

  [in] | value |

See Also
  elm_radio_value_set

Referenced by elm_radio_value_set().

## Function Documentation

Evas_Object* elm_radio_add | ( | Evas_Object * | parent | ) |

Add a new radio to the parent.

Parameters

  parent | The parent object

Returns
  The new object or NULL if it cannot be created

void elm_radio_group_add | ( | Evas_Object * | obj,
|  | Evas_Object * | group
| ) |  |

Add this radio to a group of other radio objects.

Parameters

  obj | The radio object
  group | Any object whose group the `obj` is to join.

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.

References elm_obj_radio_group_add.

Evas_Object* elm_radio_selected_object_get | ( | Evas_Object * | obj | ) |

Get the selected radio object.

Parameters

  obj | Any radio object (any object of a group)

Returns
  The selected radio object

References elm_obj_radio_selected_object_get.

int elm_radio_state_value_get | ( | const Evas_Object * | obj | ) |

Get the integer value that this radio object represents.

Parameters

  obj | The radio object

Returns
  The value used if this radio object is selected

This gets the value of the radio.

See Also
  elm_radio_value_set()

References elm_obj_radio_state_value_get.

void elm_radio_state_value_set | ( | Evas_Object * | obj,
|  | int | value
| ) |  |

Set the integer value that this radio object represents.

Parameters

  obj | The radio object
  value | The value to use if this radio object is selected

This sets the value of the radio.

References elm_obj_radio_state_value_set.

int elm_radio_value_get | ( | const Evas_Object * | obj | ) |

Get the value of the radio group.

Parameters

  obj | The radio object (any radio object of the group).

Returns
  The integer state

References elm_obj_radio_value_get.

void elm_radio_value_pointer_set | ( | Evas_Object * | obj,
|  | int * | valuep
| ) |  |

Set a convenience pointer to a integer to change when radio group value changes.

Parameters

  obj | The radio object (any object of a group)
  valuep | Pointer to the integer to modify

This sets a pointer to a integer, that, in addition to the radio objects 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 this is called, the radio objects state will also be modified to reflect the value of the integer valuep points to, just like calling elm_radio_value_set().

References elm_obj_radio_value_pointer_set.

void elm_radio_value_set | ( | Evas_Object * | obj,
|  | int | value
| ) |  |

Set the value of the radio group.

Parameters

  obj | The radio object (any radio object of the group).
  value | The value to use for the 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.

References elm_obj_radio_value_set.

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:14