60 lines
2.4 KiB
Plaintext
60 lines
2.4 KiB
Plaintext
abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Container_Selectable, Efl.Input.Clickable
|
|
{
|
|
[[Selectable Item abstraction.
|
|
|
|
This class serves as the basis to create widgets acting as selectable items inside containers
|
|
like @Efl.Ui.List or @Efl.Ui.Grid, for example.
|
|
@Efl.Ui.Item provides user interaction through the @Efl.Input.Clickable mixin.
|
|
Items can be pressed, long-pressed, etc, and appropriate events are generated.
|
|
@Efl.Ui.Item also implements the @Efl.Ui.Container_Selectable interface, meaning that "selected" and
|
|
"unselected" events are automatically generated.
|
|
|
|
Classes inheriting from this one only need to deal with the visual representation of the widget.
|
|
See for example @Efl.Ui.Grid_Default_Item and @Efl.Ui.List_Default_Item.
|
|
|
|
Some events are converted to edje signals so the theme can react to them:
|
|
@[Efl.Input.Clickable.pressed] -> "efl,state,pressed",
|
|
@[Efl.Input.Clickable.unpressed] -> "efl,state,unpressed",
|
|
@[Efl.Ui.Container_Selectable.item,selected] -> "efl,state,selected",
|
|
@[Efl.Ui.Container_Selectable.item,unselected] -> "efl,state,unselected".
|
|
]]
|
|
methods {
|
|
@property index {
|
|
[[The index of this item inside its container.
|
|
|
|
The container must be set through the @Efl.Ui.Item.container property.]]
|
|
get {}
|
|
values {
|
|
index : int; [[The index where to find this item in its $container.]]
|
|
}
|
|
}
|
|
@property selected {
|
|
[[Item selected state.
|
|
|
|
The visual representation of the item will be adjusted accordingly to the new state.
|
|
This property is also automatically modified in response to user actions.
|
|
]]
|
|
values {
|
|
select: bool; [[Whether this item is selected or not.]]
|
|
}
|
|
}
|
|
@property container {
|
|
[[The container this object is part of.
|
|
|
|
You should never use this property directly, the container will set it when the
|
|
item is added.
|
|
Unsetting this while the item is packed inside a container does not remove the item
|
|
from the container.
|
|
]]
|
|
values {
|
|
container : Efl.Ui.Widget; [[The container this item is in.]]
|
|
}
|
|
}
|
|
}
|
|
implements {
|
|
Efl.Object.constructor;
|
|
Efl.Object.finalize;
|
|
Efl.Object.destructor;
|
|
}
|
|
}
|