2015-04-22 04:43:05 -07:00
|
|
|
class Elm.Diskselector (Elm.Widget, Elm_Interface_Scrollable,
|
2015-05-07 08:14:27 -07:00
|
|
|
Elm_Interface_Atspi_Widget_Action,
|
|
|
|
Evas.Clickable_Interface, Evas.Scrollable_Interface,
|
|
|
|
Evas.Selectable_Interface)
|
2014-03-21 08:27:17 -07:00
|
|
|
{
|
|
|
|
eo_prefix: elm_obj_diskselector;
|
2015-05-07 09:32:53 -07:00
|
|
|
methods {
|
|
|
|
@property side_text_max_length {
|
2014-03-21 08:27:17 -07:00
|
|
|
set {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Set the side labels max length.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
Length is the number of characters of items' label that will be
|
|
|
|
visible when it's set on side positions. It will just crop
|
|
|
|
the string after defined size. E.g.:
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
An item with label "January" would be displayed on side position as
|
|
|
|
"Jan" if max length is set to 3, or "Janu", if this property
|
|
|
|
is set to 4.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
When it's selected, the entire label will be displayed, except for
|
|
|
|
width restrictions. In this case label will be cropped and "..."
|
|
|
|
will be concatenated.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
Default side label max length is 3.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
This property will be applied over all items, included before or
|
|
|
|
later this function call.
|
|
|
|
]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
get {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Get the side labels max length.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
See also @.side_text_max_length.set for details.
|
|
|
|
]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
values {
|
2015-07-27 02:18:43 -07:00
|
|
|
len: int; [[The max length defined for side labels.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property round_enabled {
|
2014-03-21 08:27:17 -07:00
|
|
|
set {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Enable or disable round mode.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
Disabled by default. If round mode is enabled the items list will
|
|
|
|
work like a circular list, so when the user reaches the last item,
|
|
|
|
the first one will popup.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
See also @.round_enabled.get.
|
|
|
|
]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
get {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Get a value whether round mode is enabled or not.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
See also @.round_enabled.set for details.
|
|
|
|
]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
values {
|
2015-07-27 02:18:43 -07:00
|
|
|
enabled: bool; [[$true to enable round mode or $false to
|
|
|
|
disable it.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property display_item_num {
|
2014-03-21 08:27:17 -07:00
|
|
|
set {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Set the number of items to be displayed.
|
|
|
|
|
|
|
|
Default value is 3, and also it's the minimum. If $num is less
|
|
|
|
than 3, it will be set to 3.
|
|
|
|
|
|
|
|
Also, it can be set on theme, using data item $display_item_num
|
|
|
|
on group "elm/diskselector/item/X", where X is style set.
|
|
|
|
]]
|
|
|
|
/* FIXME-doc
|
|
|
|
* E.g.:
|
|
|
|
* group { name: "elm/diskselector/item/X";
|
|
|
|
* data {
|
|
|
|
* item: "display_item_num" "5";
|
|
|
|
* }
|
|
|
|
*/
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
get {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Get the number of items in the diskselector object.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
values {
|
2015-07-27 02:18:43 -07:00
|
|
|
num: int; [[The number of items the diskselector will display.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property first_item {
|
2014-03-21 08:27:17 -07:00
|
|
|
get {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Get the first item of the diskselector.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
The list of items follows append order. So it will return the first
|
|
|
|
item appended to the widget that wasn't deleted.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
See also @.item_append,
|
|
|
|
@.items.get.
|
|
|
|
]]
|
2015-08-06 06:30:34 -07:00
|
|
|
return: Elm.Widget_Item *; [[The first item, or $null if none.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property items {
|
2014-03-21 08:27:17 -07:00
|
|
|
get {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Get a list of all the diskselector items.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
See also @.item_append,
|
|
|
|
\@ref elm_object_item_del,
|
|
|
|
@.clear.
|
|
|
|
]]
|
|
|
|
return: const(list<Elm.Object.Item*>)*; [[A $list of diskselector items, or $ull on failure.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property last_item {
|
2014-03-21 08:27:17 -07:00
|
|
|
get {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Get the last item of the diskselector.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
The list of items follows append order. So it will return last first
|
|
|
|
item appended to the widget that wasn't deleted.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
See also @.item_append,
|
|
|
|
@.items.get.
|
|
|
|
]]
|
2015-08-06 06:30:34 -07:00
|
|
|
return: Elm.Widget_Item *; [[The last item, or $null if none.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property selected_item {
|
2014-03-21 08:27:17 -07:00
|
|
|
get {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Get the selected item.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
The selected item can be unselected with function
|
|
|
|
@.selected_item.set, and the first item of
|
|
|
|
diskselector will be selected.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
The selected item always will be centered on diskselector, with
|
|
|
|
full label displayed, i.e., max length set to side labels won't
|
|
|
|
apply on the selected item. More details on
|
|
|
|
@.side_text_max_length.set.
|
|
|
|
]]
|
2015-08-06 06:30:34 -07:00
|
|
|
return: Elm.Widget_Item *; [[The selected diskselector item.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
item_append {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Appends a new item to the diskselector object.
|
|
|
|
|
|
|
|
A new item will be created and appended to the diskselector, i.e., will
|
|
|
|
be set as last item. Also, if there is no selected item, it will
|
|
|
|
be selected. This will always happens for the first appended item.
|
|
|
|
|
|
|
|
If no icon is set, label will be centered on item position, otherwise
|
|
|
|
the icon will be placed at left of the label, that will be shifted
|
|
|
|
to the right.
|
|
|
|
|
|
|
|
Items created with this method can be deleted with
|
|
|
|
\@ref elm_object_item_del.
|
|
|
|
|
|
|
|
Associated $data can be properly freed when item is deleted if a
|
|
|
|
callback function is set with \@ref elm_object_item_del_cb_set.
|
|
|
|
|
|
|
|
If a function is passed as argument, it will be called every time this item
|
|
|
|
is selected, i.e., the user stops the diskselector with this
|
|
|
|
item on center position. If such function isn't needed, just passing
|
|
|
|
$null as $func is enough. The same should be done for $data.
|
|
|
|
|
|
|
|
See also \@ref elm_object_item_del,
|
|
|
|
@.clear,
|
|
|
|
\@ref elm_icon_add.
|
|
|
|
]]
|
|
|
|
/* FIXME-doc
|
|
|
|
* Simple example (with no function callback or data associated):
|
|
|
|
* @code
|
|
|
|
* disk = elm_diskselector_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);
|
2015-07-27 02:18:43 -07:00
|
|
|
* elm_diskselector_item_append(disk, "label", ic, NULL, NULL);
|
|
|
|
* @endcode
|
|
|
|
*/
|
2015-08-06 06:30:34 -07:00
|
|
|
return: Elm.Widget_Item *;
|
2014-03-21 08:27:17 -07:00
|
|
|
params {
|
2015-07-27 02:18:43 -07:00
|
|
|
@in label: const(char)*; [[The label of the diskselector item.]]
|
|
|
|
@in icon: Evas.Object * @optional; [[The icon object to use at left side of the item. An
|
2014-03-21 08:27:17 -07:00
|
|
|
icon can be any Evas object, but usually it is an icon created
|
2015-07-27 02:18:43 -07:00
|
|
|
with elm_icon_add(). ]]
|
|
|
|
@in func: Evas_Smart_Cb @optional; [[The function to call when the item is selected.]]
|
|
|
|
@in data: const(void)* @optional; [[The data to associate with the item for related callbacks.]]
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
clear {
|
2015-07-27 02:18:43 -07:00
|
|
|
[[Remove all diskselector's items.
|
2014-03-21 08:27:17 -07:00
|
|
|
|
2015-07-27 02:18:43 -07:00
|
|
|
See also \@ref elm_object_item_del,
|
|
|
|
@.item_append.
|
|
|
|
]]
|
2014-03-21 08:27:17 -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.member_add;
|
|
|
|
Evas.Object_Smart.move;
|
|
|
|
Evas.Object_Smart.add;
|
|
|
|
Evas.Object_Smart.del;
|
|
|
|
Evas.Object_Smart.resize;
|
2015-04-22 04:33:10 -07:00
|
|
|
Elm.Widget.focus_next_manager_is;
|
|
|
|
Elm.Widget.access;
|
|
|
|
Elm.Widget.focus_next;
|
|
|
|
Elm.Widget.theme_apply;
|
|
|
|
Elm.Widget.on_focus;
|
|
|
|
Elm.Widget.translate;
|
|
|
|
Elm.Widget.sub_object_del;
|
|
|
|
Elm.Widget.event;
|
2014-06-20 02:47:39 -07:00
|
|
|
Elm_Interface_Scrollable.policy;
|
2014-07-25 01:33:19 -07:00
|
|
|
Elm_Interface_Atspi_Widget_Action.elm_actions.get;
|
2014-03-21 08:27:17 -07:00
|
|
|
}
|
|
|
|
events {
|
|
|
|
language,changed;
|
|
|
|
access,changed;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|