2019-09-10 06:44:29 -07:00
|
|
|
parse efl_gfx_hint;
|
declare first round of classes stable
this stabelizes the "stableized" column of the efl: api workboard.
fixes T8208,
fixes T8158,
fixes T8156,
fixes T8025,
fixes T8024,
fixes T7976,
fixes T7946,
fixes T7928,
fixes T7923,
fixes T7905,
fixes T7902,
fixes T7901,
fixes T7900,
fixes T7898,
fixes T7897,
fixes T7895,
fixes T7894,
fixes T7893,
fixes T7891,
fixes T7880,
fixes T7873,
fixes T7869,
fixes T7867,
fixes T7865,
fixes T7862,
fixes T7854,
fixes T7847,
fixes T7881,
fixes T7870,
fixes T9086
Differential Revision: https://phab.enlightenment.org/D10008
2019-09-09 02:23:04 -07:00
|
|
|
enum Efl.Ui.Popup_Align {
|
2019-10-14 00:55:52 -07:00
|
|
|
[[This is the alignment method for positioning Popup widgets. @since 1.23]]
|
2019-09-02 07:24:26 -07:00
|
|
|
none = 0, [[Popup not aligned.]]
|
2019-09-10 06:44:29 -07:00
|
|
|
center, [[Popup is aligned to the center of its anchor object.]]
|
|
|
|
left, [[Popup's left edge is aligned to the left side of its anchor object.]]
|
|
|
|
right, [[Popup's right edge is aligned to the right side of its anchor object.]]
|
|
|
|
top, [[Popup's top is aligned to the top of its anchor object.]]
|
|
|
|
bottom [[Popup's bottom is aligned to the bottom of its anchor object.]]
|
2017-08-17 01:37:54 -07:00
|
|
|
}
|
|
|
|
|
declare first round of classes stable
this stabelizes the "stableized" column of the efl: api workboard.
fixes T8208,
fixes T8158,
fixes T8156,
fixes T8025,
fixes T8024,
fixes T7976,
fixes T7946,
fixes T7928,
fixes T7923,
fixes T7905,
fixes T7902,
fixes T7901,
fixes T7900,
fixes T7898,
fixes T7897,
fixes T7895,
fixes T7894,
fixes T7893,
fixes T7891,
fixes T7880,
fixes T7873,
fixes T7869,
fixes T7867,
fixes T7865,
fixes T7862,
fixes T7854,
fixes T7847,
fixes T7881,
fixes T7870,
fixes T9086
Differential Revision: https://phab.enlightenment.org/D10008
2019-09-09 02:23:04 -07:00
|
|
|
class Efl.Ui.Popup extends Efl.Ui.Layout_Base implements Efl.Content, Efl.Ui.Focus.Layer,
|
2019-09-02 07:24:26 -07:00
|
|
|
Efl.Ui.Widget_Scrollable_Content
|
2017-07-27 22:48:48 -07:00
|
|
|
{
|
2019-09-10 06:44:29 -07:00
|
|
|
[[A styled container widget which overlays a window's contents.
|
|
|
|
|
|
|
|
The Popup widget is a theme-capable container which can be used for various purposes.
|
|
|
|
Regular contents can be set using the @Efl.Content interface, or basic scrollable contents
|
|
|
|
can be set through the @Efl.Ui.Widget_Scrollable_Content mixin API. For contents which
|
|
|
|
should be scrollable but require more fine-grained tuning, it may be necessary for users
|
|
|
|
to set up and provide their own scroller object such as @Efl.Ui.Scroller.
|
|
|
|
|
|
|
|
A Popup widget will create an overlay for the window contents. This overlay is an
|
|
|
|
@Efl.Ui.Popup_Part_Backwall object, which provides functionality for passing events
|
|
|
|
through to the main window while the Popup is active as well as the ability to set
|
|
|
|
background images for the Popup.
|
|
|
|
|
|
|
|
By default, a Popup is positioned by the user through the @Efl.Gfx.Entity.position property.
|
|
|
|
This behavior can be altered by using the @.align and @.anchor properties. Setting the
|
|
|
|
@Efl.Gfx.Entity.position property directly will unset both the @.align and @.anchor properties,
|
|
|
|
and vice versa.
|
|
|
|
|
|
|
|
By default, a Popup will size itself based on the minimum size of its contents through the
|
|
|
|
@Efl.Gfx.Hint interface. A Popup will never size itself smaller than the minimum size of its contents,
|
|
|
|
but by manually setting the @Efl.Gfx.Entity.size property or the @Efl.Gfx.Hint.hint_size_min property,
|
|
|
|
a larger size can be specified.
|
|
|
|
|
|
|
|
Users can set a given Popup widget to close automatically after a specified time using the @.closing_timeout
|
|
|
|
property.
|
|
|
|
|
|
|
|
For a Popup with a more specialized purpose, see @Efl.Ui.Alert_Popup.
|
2019-10-14 00:55:52 -07:00
|
|
|
|
|
|
|
@since 1.23
|
2019-09-10 06:44:29 -07:00
|
|
|
]]
|
2017-07-27 22:48:48 -07:00
|
|
|
methods {
|
2017-08-17 01:37:54 -07:00
|
|
|
@property align {
|
2019-09-10 06:44:29 -07:00
|
|
|
[[The align property specifies a Popup's current positioning relative to its anchor.
|
|
|
|
|
|
|
|
When set, this property will override any user-provided value for
|
|
|
|
the widget's @Efl.Gfx.Entity.position property.
|
|
|
|
]]
|
2017-08-17 01:37:54 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2019-09-10 06:44:29 -07:00
|
|
|
type: Efl.Ui.Popup_Align; [[Alignment of the Popup relative to its anchor.
|
|
|
|
The default is @Efl.Ui.Popup_Align.none.]]
|
2017-08-17 01:37:54 -07:00
|
|
|
}
|
|
|
|
}
|
2019-08-30 10:02:01 -07:00
|
|
|
@property closing_timeout {
|
2019-09-10 06:44:29 -07:00
|
|
|
[[The closing_timeout property is the time after which the Popup widget will be automatically deleted.
|
|
|
|
|
|
|
|
The timer is initiated at the time when the popup is shown. If the value is changed
|
|
|
|
prior to the timer expiring, the existing timer will be deleted. If the new value is greater than $0,
|
|
|
|
a new timer will be created.
|
2019-09-02 07:24:26 -07:00
|
|
|
]]
|
2017-09-21 01:21:18 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2019-09-10 06:44:29 -07:00
|
|
|
time: double; [[If greater than $0, the Popup will close automatically after the value in seconds.
|
|
|
|
The default is to not automatically delete the Popup.]]
|
2017-09-21 01:21:18 -07:00
|
|
|
}
|
|
|
|
}
|
2019-08-21 07:41:57 -07:00
|
|
|
@property anchor {
|
2019-09-10 06:44:29 -07:00
|
|
|
[[The anchor object is the reference object for positioning a Popup
|
|
|
|
using the @.align and @.align_priority properties.
|
|
|
|
|
|
|
|
A Popup will recalculate its alignment relative to its anchor and change its position when:
|
|
|
|
- the anchor object is moved (unless the anchor is a window)
|
|
|
|
- the anchor object is resized
|
|
|
|
- the Popup is resized
|
|
|
|
- the parent window is resized
|
|
|
|
|
2019-09-10 07:05:44 -07:00
|
|
|
If @.anchor.get returns $NULL, the anchor is the parent window of the Popup.
|
2019-09-10 06:44:29 -07:00
|
|
|
If the anchor object is set to $NULL, the Popup will no longer recalculate its alignment or change
|
|
|
|
its position under any circumstance.
|
2019-09-10 07:05:44 -07:00
|
|
|
If the Popup is moved by using @Efl.Gfx.Entity.position.set, $anchor is set $NULL.
|
2019-09-02 07:24:26 -07:00
|
|
|
]]
|
2019-08-21 07:41:57 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2019-09-10 06:44:29 -07:00
|
|
|
anchor: Efl.Canvas.Object; [[The object which Popup is following. By default this is $NULL.]]
|
2019-08-21 07:41:57 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property align_priority {
|
2019-09-10 06:44:29 -07:00
|
|
|
[[This is the priority in which alignments will be tested using the anchor object if the value of @.align
|
|
|
|
is determined to be invalid. If a given alignment would result in the popup being partially or fully
|
|
|
|
outside the visible area of the window, it is deemed invalid, and the next alignment is tested
|
|
|
|
until either the priority list is exhausted or a usable alignment is found.
|
|
|
|
|
|
|
|
An alignment will also be deemed invalid if the popup occludes its anchor object,
|
|
|
|
except if @Efl.Ui.Popup_Align.center is specified.
|
2019-09-02 07:24:26 -07:00
|
|
|
]]
|
2019-08-21 07:41:57 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2019-09-10 06:44:29 -07:00
|
|
|
first: Efl.Ui.Popup_Align; [[First alignment. The default is @Efl.Ui.Popup_Align.top.]]
|
|
|
|
second: Efl.Ui.Popup_Align; [[Second alignment. The default is @Efl.Ui.Popup_Align.left.]]
|
|
|
|
third: Efl.Ui.Popup_Align; [[Third alignment. The default is @Efl.Ui.Popup_Align.right.]]
|
|
|
|
fourth: Efl.Ui.Popup_Align; [[Fourth alignment. The default is @Efl.Ui.Popup_Align.bottom.]]
|
|
|
|
fifth: Efl.Ui.Popup_Align; [[Fifth alignment. The default is @Efl.Ui.Popup_Align.center.]]
|
2019-08-21 07:41:57 -07:00
|
|
|
}
|
|
|
|
}
|
2017-07-27 22:48:48 -07:00
|
|
|
}
|
2017-11-10 00:56:34 -08:00
|
|
|
parts {
|
2019-09-10 06:44:29 -07:00
|
|
|
backwall: Efl.Ui.Popup_Part_Backwall; [[A backwall behind the Popup.]]
|
2017-11-10 00:56:34 -08:00
|
|
|
}
|
2017-07-27 22:48:48 -07:00
|
|
|
implements {
|
2017-10-24 05:29:15 -07:00
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.destructor;
|
2017-12-08 01:11:09 -08:00
|
|
|
Efl.Canvas.Group.group_calculate;
|
2018-04-05 01:47:26 -07:00
|
|
|
Efl.Gfx.Entity.position { set; }
|
|
|
|
Efl.Gfx.Entity.size { set;}
|
|
|
|
Efl.Gfx.Entity.visible { set; }
|
2018-01-07 20:55:35 -08:00
|
|
|
Efl.Ui.Widget.widget_parent { set; }
|
2017-11-27 01:50:11 -08:00
|
|
|
Efl.Content.content { get; set; }
|
|
|
|
Efl.Content.content_unset;
|
2018-05-03 16:34:17 -07:00
|
|
|
Efl.Part.part_get;
|
2017-07-27 22:48:48 -07:00
|
|
|
}
|
2017-08-09 23:48:36 -07:00
|
|
|
events {
|
2019-09-10 06:44:29 -07:00
|
|
|
backwall,clicked: void; [[This is called whenever the user clicks the backwall part of the Popup.]]
|
|
|
|
timeout: void; [[This is called when Popup times out.]]
|
2017-08-09 23:48:36 -07:00
|
|
|
}
|
2017-07-27 22:48:48 -07:00
|
|
|
}
|