Tizen Native API
3.0
|
Widget to display text, with simple html-like markup.
The Label widget doesn't allow text to overflow its boundaries, if the text doesn't fit the geometry of the label it will be ellipsized or be cut. Elementary provides several styles for this widget:
- default - No animation
- marker - Centers the text in the label and makes it bold by default
- slide_long - The entire text appears from the right of the screen and slides until it disappears in the left of the screen(reappearing on the right again).
- slide_short - The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the position is reset.
- slide_bounce - The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the animation reverses, moving the text to the left.
Custom themes can of course invent new markup tags and style them any way they like.
This widget inherits from the Layout one, so that all the functions acting on it also work for label objects.
This widget emits the following signals, besides the ones sent from Elm_Layout:
"language,changed"
: The program's language changed."slide,end"
: The slide is end.
See Label example for a demonstration of how to use a label widget.
Functions | |
void | elm_label_wrap_width_set (Elm_Label *obj, Evas_Coord w) |
Control wrap width of the label. | |
Evas_Coord | elm_label_wrap_width_get (const Elm_Label *obj) |
Control wrap width of the label. | |
void | elm_label_slide_speed_set (Elm_Label *obj, double speed) |
Control the slide speed of the label. | |
double | elm_label_slide_speed_get (const Elm_Label *obj) |
Control the slide speed of the label. | |
void | elm_label_slide_mode_set (Elm_Label *obj, Elm_Label_Slide_Mode mode) |
Control the slide mode of the label widget. | |
Elm_Label_Slide_Mode | elm_label_slide_mode_get (const Elm_Label *obj) |
Control the slide mode of the label widget. | |
void | elm_label_slide_duration_set (Elm_Label *obj, double duration) |
Control the slide duration of the label. | |
double | elm_label_slide_duration_get (const Elm_Label *obj) |
Control the slide duration of the label. | |
void | elm_label_line_wrap_set (Elm_Label *obj, Elm_Wrap_Type wrap) |
Control the wrapping behavior of the label. | |
Elm_Wrap_Type | elm_label_line_wrap_get (const Elm_Label *obj) |
Control the wrapping behavior of the label. | |
void | elm_label_ellipsis_set (Elm_Label *obj, Eina_Bool ellipsis) |
Control the ellipsis behavior of the label. | |
Eina_Bool | elm_label_ellipsis_get (const Elm_Label *obj) |
Control the ellipsis behavior of the label. | |
void | elm_label_slide_go (Elm_Label *obj) |
Start slide effect. | |
Evas_Object * | elm_label_add (Evas_Object *parent) |
Add a new label to the parent. |
Enumeration Type Documentation
enum Elm_Label_Slide_Mode |
Function Documentation
Evas_Object* elm_label_add | ( | Evas_Object * | parent | ) |
Add a new label to the parent.
- Parameters:
-
parent The parent object
- Returns:
- The new object or NULL if it cannot be created
- Since :
- 2.3.1
Eina_Bool elm_label_ellipsis_get | ( | const Elm_Label * | obj | ) |
Control the ellipsis behavior of the label.
If set to true and the text doesn't fit in the label an ellipsis("...") will be shown at the end of the widget.
Warning This doesn't work with slide(elm_label_slide_set()) or if the chosen wrap method was ELM_WRAP_WORD
.
- Since :
- 2.3.1
- Returns:
- To ellipsis text or not
void elm_label_ellipsis_set | ( | Elm_Label * | obj, |
Eina_Bool | ellipsis | ||
) |
Control the ellipsis behavior of the label.
If set to true and the text doesn't fit in the label an ellipsis("...") will be shown at the end of the widget.
Warning This doesn't work with slide(elm_label_slide_set()) or if the chosen wrap method was ELM_WRAP_WORD
.
- Since :
- 2.3.1
- Parameters:
-
[in] ellipsis To ellipsis text or not
Elm_Wrap_Type elm_label_line_wrap_get | ( | const Elm_Label * | obj | ) |
Control the wrapping behavior of the label.
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
- Since :
- 2.3.1
- Returns:
- To wrap text or not
void elm_label_line_wrap_set | ( | Elm_Label * | obj, |
Elm_Wrap_Type | wrap | ||
) |
Control the wrapping behavior of the label.
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
- Since :
- 2.3.1
- Parameters:
-
[in] wrap To wrap text or not
double elm_label_slide_duration_get | ( | const Elm_Label * | obj | ) |
Control the slide duration of the label.
- Note:
- If you set the speed of the slide using elm_label_slide_speed_set you cannot get the correct duration using this function until the label is actually rendered and resized.
- Since :
- 2.3.1
- Returns:
- The duration in seconds in moving text from slide begin position to slide end position
void elm_label_slide_duration_set | ( | Elm_Label * | obj, |
double | duration | ||
) |
Control the slide duration of the label.
- Note:
- If you set the speed of the slide using elm_label_slide_speed_set you cannot get the correct duration using this function until the label is actually rendered and resized.
- Since :
- 2.3.1
- Parameters:
-
[in] duration The duration in seconds in moving text from slide begin position to slide end position
void elm_label_slide_go | ( | Elm_Label * | obj | ) |
Elm_Label_Slide_Mode elm_label_slide_mode_get | ( | const Elm_Label * | obj | ) |
Control the slide mode of the label widget.
By default, slide mode is none. Possible values for mode
are: Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_NONE - no slide effect Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than the text width length Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_ALWAYS - slide always
- Warning:
- Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_AUTO, Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_ALWAYS only work with the themes "slide_short", "slide_long" and "slide_bounce". Warning: Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_AUTO, Elm_Label_Slide_Mode::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.
- Since :
- 2.3.1
- Returns:
- The slide mode
- Since (EFL) :
- 1.8
void elm_label_slide_mode_set | ( | Elm_Label * | obj, |
Elm_Label_Slide_Mode | mode | ||
) |
Control the slide mode of the label widget.
By default, slide mode is none. Possible values for mode
are: Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_NONE - no slide effect Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than the text width length Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_ALWAYS - slide always
- Warning:
- Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_AUTO, Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_ALWAYS only work with the themes "slide_short", "slide_long" and "slide_bounce". Warning: Elm_Label_Slide_Mode::ELM_LABEL_SLIDE_MODE_AUTO, Elm_Label_Slide_Mode::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.
- Since :
- 2.3.1
- Parameters:
-
[in] mode The slide mode
- Since (EFL) :
- 1.8
double elm_label_slide_speed_get | ( | const Elm_Label * | obj | ) |
Control the slide speed of the label.
- Note:
- If you set the duration of the slide using elm_label_slide_duration_set you cannot get the correct speed using this function until the label is actually rendered and resized.
See elm_label_slide_duration_set
- Since :
- 3.0
- Returns:
- The speed of the slide animation in px per seconds
void elm_label_slide_speed_set | ( | Elm_Label * | obj, |
double | speed | ||
) |
Control the slide speed of the label.
- Note:
- If you set the duration of the slide using elm_label_slide_duration_set you cannot get the correct speed using this function until the label is actually rendered and resized.
See elm_label_slide_duration_set
- Since :
- 3.0
- Parameters:
-
[in] speed The speed of the slide animation in px per seconds
Evas_Coord elm_label_wrap_width_get | ( | const Elm_Label * | obj | ) |
Control wrap width of the label.
This function sets the minimum and the maximum width size hint of the label.
When the width is set to 0, there will be no size hint for both the minimum and the maximum width.
- Warning:
- This is only relevant if the label is inside a container. When a wrap mode is disabled, only the minimum size hint will be decided. That is, with this case, the maximum size hint does not be used.
- Since :
- 2.3.1
- Returns:
- The wrap width in pixels where words need to wrap
void elm_label_wrap_width_set | ( | Elm_Label * | obj, |
Evas_Coord | w | ||
) |
Control wrap width of the label.
This function sets the minimum and the maximum width size hint of the label.
When the width is set to 0, there will be no size hint for both the minimum and the maximum width.
- Warning:
- This is only relevant if the label is inside a container. When a wrap mode is disabled, only the minimum size hint will be decided. That is, with this case, the maximum size hint does not be used.
- Since :
- 2.3.1
- Parameters:
-
[in] w The wrap width in pixels where words need to wrap