Tizen Native API
|
Functions | |
Evas_Object * | elm_segment_control_add (Evas_Object *parent) |
Adds a new segment control widget to the given parent Elementary (container) object. | |
Elm_Object_Item * | elm_segment_control_item_add (Evas_Object *obj, Evas_Object *icon, const char *label) |
Appends a new item to the segment control object. | |
Elm_Object_Item * | elm_segment_control_item_insert_at (Evas_Object *obj, Evas_Object *icon, const char *label, int index) |
Inserts a new item to the segment control object at the specified position. | |
void | elm_segment_control_item_del_at (Evas_Object *obj, int index) |
Removes a segment control item at the given index from its parent, deleting it. | |
int | elm_segment_control_item_count_get (const Evas_Object *obj) |
Gets the segment items count from the segment control. | |
Elm_Object_Item * | elm_segment_control_item_get (const Evas_Object *obj, int index) |
Gets the item placed at the specified index. | |
const char * | elm_segment_control_item_label_get (const Evas_Object *obj, int index) |
Gets the label of the item. | |
Evas_Object * | elm_segment_control_item_icon_get (const Evas_Object *obj, int index) |
Gets the icon associated to the item. | |
int | elm_segment_control_item_index_get (const Elm_Object_Item *it) |
Gets the index of an item. | |
Evas_Object * | elm_segment_control_item_object_get (const Elm_Object_Item *it) |
Gets the base object of the item. | |
Elm_Object_Item * | elm_segment_control_item_selected_get (const Evas_Object *obj) |
Gets the selected item. | |
void | elm_segment_control_item_selected_set (Elm_Object_Item *it, Eina_Bool select) |
Sets the selected state of an item. |
Segment control widget is a horizontal control made of multiple segment items, each segment item functioning similar to a discrete two state button.
A segment control groups the items together and provides a compact single button with multiple equal size segments.
Segment item size is determined by base widget size and the number of items added. Only one segment item can be at a selected state. A segment item can display a combination of Text and any Evas_Object like Images or other widgets.
This widget inherits from the Layout one, so that all the functions acting on it also work for segment control objects.
This widget emits the following signals, besides the ones sent from Layout :
"changed"
- When the user clicks on a segment item which is not previously selected and it gets selected. The event_info parameter is the segment item pointer.Available styles for it:
"default"
The default content parts of the segment control items that you can use are:
The default text parts of the segment control items that you can use are:
Supported common elm_object APIs.
Supported common elm_object_item APIs.
Evas_Object* elm_segment_control_add | ( | Evas_Object * | parent | ) |
Adds a new segment control widget to the given parent Elementary (container) object.
This function inserts a new segment control widget on the canvas.
[in] | parent | The parent object |
NULL
in case of an error Elm_Object_Item* elm_segment_control_item_add | ( | Evas_Object * | obj, |
Evas_Object * | icon, | ||
const char * | label | ||
) |
Appends a new item to the segment control object.
NULL
is different from an empty string "". If an item only has icon, it is displayed bigger and it is centered. If it has an icon and a label, even an empty string, the icon is smaller and positioned towards the left.Simple example:
sc = elm_segment_control_add(win); ic = elm_icon_add(win); elm_image_file_set(ic, "path/to/image", NULL); elm_segment_control_item_add(sc, ic, "label"); evas_object_show(sc);
[in] | obj | The segment control object. |
[in] | icon | The icon object to use for the left side of the item An icon can be any Evas object, but usually it is an icon created with elm_icon_add(). |
[in] | label | The label of the item Note that, NULL is different from an empty string "". |
NULL
on failureint elm_segment_control_item_count_get | ( | const Evas_Object * | obj | ) |
Gets the segment items count from the segment control.
It just returns the number of items added to the segment control obj.
[in] | obj | The segment control object |
void elm_segment_control_item_del_at | ( | Evas_Object * | obj, |
int | index | ||
) |
Removes a segment control item at the given index from its parent, deleting it.
[in] | obj | The segment control object |
[in] | index | The position of the segment control item to be deleted |
Elm_Object_Item* elm_segment_control_item_get | ( | const Evas_Object * | obj, |
int | index | ||
) |
Gets the item placed at the specified index.
0
to count - 1
. Count is the number of items, that can be obtained with elm_segment_control_item_count_get().[in] | obj | The segment control object |
[in] | index | The index of the segment item |
NULL
on failure Evas_Object* elm_segment_control_item_icon_get | ( | const Evas_Object * | obj, |
int | index | ||
) |
Gets the icon associated to the item.
NULL
.[in] | obj | The segment control object |
[in] | index | The index of the segment item |
int elm_segment_control_item_index_get | ( | const Elm_Object_Item * | it | ) |
Gets the index of an item.
0
to count - 1
. Count is the number of items, that can be obtained with elm_segment_control_item_count_get().[in] | it | The segment control item |
Elm_Object_Item* elm_segment_control_item_insert_at | ( | Evas_Object * | obj, |
Evas_Object * | icon, | ||
const char * | label, | ||
int | index | ||
) |
Inserts a new item to the segment control object at the specified position.
0
, when the item is prepended to the segment control, and items count, that can be obtained with elm_segment_control_item_count_get(), similar to the case when the item is appended to the segment control, just like elm_segment_control_item_add().NULL
is different from an empty string "". If an item only has an icon, it is displayed bigger and it is centered. If it has an icon and a label, even an empty string, the icon is smaller and positioned towards the left.[in] | obj | The segment control object |
[in] | icon | The icon object to use for the left side of the item An icon can be any Evas object, but usually it is an icon created with elm_icon_add(). |
[in] | label | The label of the item |
[in] | index | The item position The value should be between 0 and the items count. |
NULL
on failureconst char* elm_segment_control_item_label_get | ( | const Evas_Object * | obj, |
int | index | ||
) |
Gets the label of the item.
NULL
.[in] | obj | The segment control object |
[in] | index | The index of the segment item |
Evas_Object* elm_segment_control_item_object_get | ( | const Elm_Object_Item * | it | ) |
Gets the base object of the item.
Evas_Object
that represents that item.[in] | it | The segment control item |
Elm_Object_Item* elm_segment_control_item_selected_get | ( | const Evas_Object * | obj | ) |
Gets the selected item.
[in] | obj | The segment control object |
NULL
if none of the segment items are selected void elm_segment_control_item_selected_set | ( | Elm_Object_Item * | it, |
Eina_Bool | select | ||
) |
Sets the selected state of an item.
This sets the selected state of the given item it. EINA_TRUE
for selected, EINA_FALSE
for not selected.
[in] | it | The segment control item |
[in] | select | The selected state |