2015-04-22 04:43:05 -07:00
|
|
|
class Elm.Segment_Control (Elm.Layout)
|
2014-03-26 02:04:37 -07:00
|
|
|
{
|
|
|
|
eo_prefix: elm_obj_segment_control;
|
2015-05-07 09:32:53 -07:00
|
|
|
methods {
|
|
|
|
@property item_count {
|
2014-03-26 02:04:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get the Segment items count from segment control.
|
|
|
|
|
|
|
|
@return Segment items count.
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
It will just return the number of items added to segment control $obj.
|
2014-03-26 02:04:37 -07:00
|
|
|
|
|
|
|
@ingroup SegmentControl */
|
2014-08-11 07:46:11 -07:00
|
|
|
return: int;
|
2014-03-26 02:04:37 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property item_selected {
|
2014-03-26 02:04:37 -07:00
|
|
|
get {
|
|
|
|
/*@
|
|
|
|
Get the selected item.
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
@return The selected item or $NULL if none of segment items is
|
2014-03-26 02:04:37 -07:00
|
|
|
selected.
|
|
|
|
|
|
|
|
The selected item can be unselected with function
|
|
|
|
elm_segment_control_item_selected_set().
|
|
|
|
|
|
|
|
The selected item always will be highlighted on segment control.
|
|
|
|
|
|
|
|
@ingroup SegmentControl */
|
2015-08-06 06:30:34 -07:00
|
|
|
return: Elm.Widget_Item *;
|
2014-03-26 02:04:37 -07:00
|
|
|
}
|
|
|
|
}
|
2014-07-22 09:13:52 -07:00
|
|
|
item_label_get @const {
|
2014-03-26 02:04:37 -07:00
|
|
|
/*@
|
|
|
|
Get the label of item.
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
@return The label of the item at $index.
|
2014-03-26 02:04:37 -07:00
|
|
|
|
|
|
|
The return value is a pointer to the label associated to the item when
|
|
|
|
it was created, with function elm_segment_control_item_add(), or later
|
|
|
|
with function elm_object_item_text_set. If no label
|
2015-08-06 07:12:27 -07:00
|
|
|
was passed as argument, it will return $NULL.
|
2014-03-26 02:04:37 -07:00
|
|
|
|
|
|
|
@see elm_object_item_text_set() for more details.
|
|
|
|
@see elm_segment_control_item_add()
|
|
|
|
|
|
|
|
@ingroup SegmentControl */
|
2014-08-11 07:46:11 -07:00
|
|
|
return: const(char)*;
|
2014-03-26 02:04:37 -07:00
|
|
|
params {
|
2015-05-18 08:16:08 -07:00
|
|
|
@in idx: int; /*@ The index of the segment item. */
|
2014-03-26 02:04:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
item_insert_at {
|
|
|
|
/*@
|
|
|
|
Insert a new item to the segment control object at specified position.
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
@return The created item or $NULL upon failure.
|
2014-03-26 02:04:37 -07:00
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
Index values must be between $0, when item will be prepended to
|
2014-03-26 02:04:37 -07:00
|
|
|
segment control, and items count, that can be get with
|
|
|
|
elm_segment_control_item_count_get(), case when item will be appended
|
|
|
|
to segment control, just like elm_segment_control_item_add().
|
|
|
|
|
|
|
|
Items created with this function can be deleted with function
|
|
|
|
elm_object_item_del() or elm_segment_control_item_del_at().
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
@note $label set to $NULL is different from empty string "".
|
2014-03-26 02:04:37 -07:00
|
|
|
If an item
|
|
|
|
only has icon, it will be displayed bigger and centered. If it has
|
|
|
|
icon and label, even that an empty string, icon will be smaller and
|
|
|
|
positioned at left.
|
|
|
|
|
|
|
|
@see elm_segment_control_item_add()
|
|
|
|
@see elm_segment_control_item_count_get()
|
|
|
|
@see elm_object_item_del()
|
|
|
|
|
|
|
|
@ingroup SegmentControl */
|
|
|
|
|
2015-08-06 06:30:34 -07:00
|
|
|
return: Elm.Widget_Item *;
|
2014-03-26 02:04:37 -07:00
|
|
|
params {
|
2015-06-26 07:36:43 -07:00
|
|
|
@in icon: Evas.Object * @optional; /*@ The icon object to use for the left side of the item. An
|
2014-03-26 02:04:37 -07:00
|
|
|
icon can be any Evas object, but usually it is an icon created
|
|
|
|
with elm_icon_add(). */
|
2015-05-18 08:16:08 -07:00
|
|
|
@in label: const(char)* @optional; /*@ The label of the item. */
|
|
|
|
@in idx: int; /*@ Item position. Value should be between 0 and items count. */
|
2014-03-26 02:04:37 -07:00
|
|
|
}
|
|
|
|
}
|
2014-07-22 09:13:52 -07:00
|
|
|
item_get @const {
|
2014-03-26 02:04:37 -07:00
|
|
|
/*@
|
|
|
|
Get the item placed at specified index.
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
@return The segment control item or $NULL on failure.
|
2014-03-26 02:04:37 -07:00
|
|
|
|
|
|
|
Index is the position of an item in segment control widget. Its
|
2015-08-06 07:12:27 -07:00
|
|
|
range is from $0 to <tt> count - 1 </tt>.
|
2014-03-26 02:04:37 -07:00
|
|
|
Count is the number of items, that can be get with
|
|
|
|
elm_segment_control_item_count_get().
|
|
|
|
|
|
|
|
@ingroup SegmentControl */
|
2015-08-06 06:30:34 -07:00
|
|
|
return: Elm.Widget_Item *;
|
2014-03-26 02:04:37 -07:00
|
|
|
params {
|
2015-05-18 08:16:08 -07:00
|
|
|
@in idx: int; /*@ The index of the segment item. */
|
2014-03-26 02:04:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
item_del_at {
|
|
|
|
/*@
|
|
|
|
Remove a segment control item at given index from its parent,
|
|
|
|
deleting it.
|
|
|
|
|
|
|
|
Items can be added with elm_segment_control_item_add() or
|
|
|
|
elm_segment_control_item_insert_at().
|
|
|
|
|
|
|
|
@ingroup SegmentControl */
|
|
|
|
|
|
|
|
params {
|
2015-05-18 08:16:08 -07:00
|
|
|
@in idx: int; /*@ The position of the segment control item to be deleted. */
|
2014-03-26 02:04:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
item_add {
|
|
|
|
/*@
|
|
|
|
Append a new item to the segment control object.
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
@return The created item or $NULL upon failure.
|
2014-03-26 02:04:37 -07:00
|
|
|
|
|
|
|
A new item will be created and appended to the segment control, i.e., will
|
|
|
|
be set as @b last item.
|
|
|
|
|
|
|
|
If it should be inserted at another position,
|
|
|
|
elm_segment_control_item_insert_at() should be used instead.
|
|
|
|
|
|
|
|
Items created with this function can be deleted with function
|
|
|
|
elm_object_item_del() or elm_object_item_del_at().
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
@note $label set to $NULL is different from empty string "".
|
2014-03-26 02:04:37 -07:00
|
|
|
If an item
|
|
|
|
only has icon, it will be displayed bigger and centered. If it has
|
|
|
|
icon and label, even that an empty string, icon will be smaller and
|
|
|
|
positioned at left.
|
|
|
|
|
|
|
|
Simple example:
|
|
|
|
@code
|
|
|
|
sc = elm_segment_control_add(win);
|
|
|
|
ic = elm_icon_add(win);
|
|
|
|
elm_image_file_set(ic, "path/to/image", NULL);
|
2015-08-06 07:11:22 -07:00
|
|
|
elm_icon_resizable_set(ic, true, true);
|
2014-03-26 02:04:37 -07:00
|
|
|
elm_segment_control_item_add(sc, ic, "label");
|
|
|
|
evas_object_show(sc);
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@see elm_segment_control_item_insert_at()
|
|
|
|
@see elm_object_item_del()
|
|
|
|
|
|
|
|
@ingroup SegmentControl */
|
|
|
|
|
2015-08-06 06:30:34 -07:00
|
|
|
return: Elm.Widget_Item *;
|
2014-03-26 02:04:37 -07:00
|
|
|
params {
|
2015-06-26 07:36:43 -07:00
|
|
|
@in icon: Evas.Object * @optional; /*@ The icon object to use for the left side of the item. An
|
2014-03-26 02:04:37 -07:00
|
|
|
icon can be any Evas object, but usually it is an icon created
|
|
|
|
with elm_icon_add(). */
|
2015-05-18 08:16:08 -07:00
|
|
|
@in label: const(char)* @optional; /*@ The label of the item.
|
2014-03-26 02:04:37 -07:00
|
|
|
Note that, NULL is different from empty string "". */
|
|
|
|
}
|
|
|
|
}
|
2014-07-22 09:13:52 -07:00
|
|
|
item_icon_get @const {
|
2014-03-26 02:04:37 -07:00
|
|
|
/*@
|
|
|
|
Get the icon associated to the item.
|
|
|
|
|
2015-08-06 07:12:27 -07:00
|
|
|
@return The left side icon associated to the item at $index.
|
2014-03-26 02:04:37 -07:00
|
|
|
|
|
|
|
The return value is a pointer to the icon associated to the item when
|
|
|
|
it was created, with function elm_segment_control_item_add(), or later
|
|
|
|
with function elm_object_item_part_content_set(). If no icon
|
2015-08-06 07:12:27 -07:00
|
|
|
was passed as argument, it will return $NULL.
|
2014-03-26 02:04:37 -07:00
|
|
|
|
|
|
|
@see elm_segment_control_item_add()
|
|
|
|
@see elm_object_item_part_content_set()
|
|
|
|
|
|
|
|
@ingroup SegmentControl */
|
2015-06-26 07:36:43 -07:00
|
|
|
return: Evas.Object *;
|
2014-03-26 02:04:37 -07:00
|
|
|
params {
|
2015-05-18 08:16:08 -07:00
|
|
|
@in idx: int; /*@ The index of the segment item. */
|
2014-03-26 02:04:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
implements {
|
2014-06-20 02:47:39 -07:00
|
|
|
class.constructor;
|
2014-06-27 15:36:05 -07:00
|
|
|
Eo.Base.constructor;
|
|
|
|
Evas.Object_Smart.add;
|
|
|
|
Evas.Object_Smart.del;
|
2015-04-22 04:33:10 -07:00
|
|
|
Elm.Widget.theme_apply;
|
|
|
|
Elm.Widget.focus_next_manager_is;
|
|
|
|
Elm.Widget.focus_next;
|
|
|
|
Elm.Widget.focus_direction_manager_is;
|
|
|
|
Elm.Widget.access;
|
|
|
|
Elm.Widget.disable;
|
|
|
|
Elm.Widget.translate;
|
2015-04-22 04:37:40 -07:00
|
|
|
Elm.Layout.sizing_eval;
|
2014-03-26 02:04:37 -07:00
|
|
|
}
|
|
|
|
events {
|
|
|
|
changed;
|
|
|
|
language,changed;
|
|
|
|
access,changed;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|