2015-07-08 04:42:17 -07:00
|
|
|
import elm_general;
|
|
|
|
|
2015-07-08 02:18:03 -07:00
|
|
|
enum Elm.Label.Slide_Mode
|
|
|
|
{
|
2015-07-08 07:49:38 -07:00
|
|
|
[[Slide mode of a label widget]]
|
2015-07-08 02:18:03 -07:00
|
|
|
none = 0, [[No slide effect.]]
|
|
|
|
auto, [[Slide only if the label area is bigger than the text width length.]]
|
|
|
|
always [[Slide always.]]
|
|
|
|
}
|
|
|
|
|
2015-04-22 04:43:05 -07:00
|
|
|
class Elm.Label (Elm.Layout)
|
2014-03-23 05:42:31 -07:00
|
|
|
{
|
|
|
|
eo_prefix: elm_obj_label;
|
2015-05-07 09:32:53 -07:00
|
|
|
methods {
|
|
|
|
@property wrap_width {
|
2015-08-07 06:10:49 -07:00
|
|
|
[[Control wrap width of the label
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
This function sets the maximum width size hint of the label.
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
Warning: This is only relevant if the label is inside a container.]]
|
|
|
|
set {
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-07 06:10:49 -07:00
|
|
|
w: Evas.Coord; [[The wrap width in pixels at a minimum where words need to wrap]]
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property slide_speed {
|
2015-08-07 06:10:49 -07:00
|
|
|
[[Control the slide speed of the label
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
Note: If you set the duration of the slide using @.slide_duration.set
|
|
|
|
you cannot get the correct speed using this function until the label
|
|
|
|
is actually rendered and resized.
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
See @.slide_duration.set]]
|
|
|
|
set {
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-07 06:10:49 -07:00
|
|
|
speed: double; [[The speed of the slide animation in px per seconds]]
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property slide_mode {
|
2015-08-07 06:10:49 -07:00
|
|
|
[[Control the slide mode of the label widget.
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
By default, slide mode is none. Possible values for $mode are:
|
|
|
|
@Elm.Label.Slide_Mode.none - no slide effect
|
|
|
|
@Elm.Label.Slide_Mode.auto - slide only if the label area is bigger than
|
|
|
|
the text width length
|
|
|
|
@Elm.Label.Slide_Mode.always - slide always
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
Warning: @Elm.Label.Slide_Mode.auto, @Elm.Label.Slide_Mode.always only work
|
|
|
|
with the themes "slide_short", "slide_long" and "slide_bounce".
|
|
|
|
Warning: @Elm.Label.Slide_Mode.auto, @Elm.Label.Slide_Mode.always don't work
|
|
|
|
if the line wrap(elm_label_line_wrap_set()) or
|
|
|
|
ellipsis(elm_label_ellipsis_set()) is set.
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
@since 1.8]]
|
|
|
|
set {
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-07 06:10:49 -07:00
|
|
|
mode: Elm.Label.Slide_Mode; [[The slide mode]]
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property slide_duration {
|
2015-08-07 06:10:49 -07:00
|
|
|
[[Control the slide duration of the label
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
Note: If you set the speed of the slide using @.slide_speed.set
|
|
|
|
you cannot get the correct duration using this function until the label
|
|
|
|
is actually rendered and resized.]]
|
|
|
|
set {
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-07 06:10:49 -07:00
|
|
|
duration: double; [[The duration in seconds in moving text from slide begin position to slide end position]]
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property line_wrap {
|
2015-08-07 06:10:49 -07:00
|
|
|
[[Control the wrapping behavior of the label
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
By default no wrapping is done. Possible values for $wrap are:
|
|
|
|
$ELM_WRAP_NONE - No wrapping
|
|
|
|
$ELM_WRAP_CHAR - wrap between characters
|
|
|
|
$ELM_WRAP_WORD - wrap between words
|
|
|
|
$ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap]]
|
|
|
|
set {
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-07 06:10:49 -07:00
|
|
|
wrap: Elm.Wrap.Type; [[To wrap text or not]]
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 09:32:53 -07:00
|
|
|
@property ellipsis {
|
2015-08-07 06:10:49 -07:00
|
|
|
[[Control the ellipsis behavior of the label
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
If set to true and the text doesn't fit in the label an ellipsis("...")
|
|
|
|
will be shown at the end of the widget.
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
Warning This doesn't work with slide(elm_label_slide_set()) or if the
|
|
|
|
chosen wrap method was $ELM_WRAP_WORD.]]
|
|
|
|
set {
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2015-08-07 06:10:49 -07:00
|
|
|
ellipsis: bool; [[To ellipsis text or not]]
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
slide_go {
|
2015-08-07 06:10:49 -07:00
|
|
|
[[Start slide effect.
|
2014-03-23 05:42:31 -07:00
|
|
|
|
2015-08-07 06:10:49 -07:00
|
|
|
See @.slide_mode.set.]]
|
2014-03-23 05:42:31 -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;
|
2015-04-22 04:33:10 -07:00
|
|
|
Elm.Widget.focus_next_manager_is;
|
|
|
|
Elm.Widget.focus_direction_manager_is;
|
|
|
|
Elm.Widget.theme_apply;
|
2015-04-22 04:37:40 -07:00
|
|
|
Elm.Layout.text_set;
|
|
|
|
Elm.Layout.text_aliases.get;
|
|
|
|
Elm.Layout.sizing_eval;
|
2014-03-23 05:42:31 -07:00
|
|
|
}
|
|
|
|
events {
|
|
|
|
language,changed;
|
|
|
|
access,changed;
|
|
|
|
slide,end;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|