lv_span.h

API reference for lv_span.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_span_private.h

Functions

lv_span_set_text

Set a new text for a span. Memory will be allocated to store the text by the span. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore lv_spangroup_refresh(spangroup) needs to be called manually,

 
void lv_span_set_text(lv_span_t *span, const char *text)
Parameters
NameTypeDescription
spanlv_span_t *pointer to a span.
textconst char *pointer to a text.

lv_span_set_text_fmt

Set a new text for a span using a printf-like formatting string. Memory will be allocated to store the text by the span. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore lv_spangroup_refresh(spangroup) needs to be called manually,

 
void lv_span_set_text_fmt(lv_span_t *span, const char *fmt,...)
Parameters
NameTypeDescription
spanlv_span_t *pointer to a span.
fmtconst char *printf-like format string
...

lv_span_set_text_static

Set a static text. It will not be saved by the span so the 'text' variable has to be 'alive' while the span exist. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore lv_spangroup_refresh(spangroup) needs to be called manually,

Set a static text. It will not be saved by the span so the 'text' variable has to be 'alive' while the span exist.

 
void lv_span_set_text_static(lv_span_t *span, const char *text)
Parameters
NameTypeDescription
spanlv_span_t *pointer to a span.
textconst char *pointer to a text.

lv_spangroup_set_span_text

Set a new text for a span. Memory will be allocated to store the text by the span.

 
void lv_spangroup_set_span_text(lv_obj_t *obj, lv_span_t *span, const char *text)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a spangroup widget.
spanlv_span_t *pointer to a span.
textconst char *pointer to a text.

lv_spangroup_set_span_text_static

Set a new text for a span. Memory will be allocated to store the text by the span.

 
void lv_spangroup_set_span_text_static(lv_obj_t *obj, lv_span_t *span, const char *text)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a spangroup widget.
spanlv_span_t *pointer to a span.
textconst char *pointer to a text.

lv_spangroup_set_span_text_fmt

Set a new text for a span using a printf-like formatting string. Memory will be allocated to store the text by the span.

 
void lv_spangroup_set_span_text_fmt(lv_obj_t *obj, lv_span_t *span, const char *fmt,...)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a spangroup widget.
spanlv_span_t *pointer to a span.
fmtconst char *printf-like format string
...

lv_spangroup_set_span_style

Copy all style properties of style to the bbuilt-in static style of the span.

 
void lv_spangroup_set_span_style(lv_obj_t *obj, lv_span_t *span, const lv_style_t *style)
Parameters
NameTypeDescription
objlv_obj_t *pointer_to a spangroup
spanlv_span_t *pointer to a span.
styleconst lv_style_t *pointer to a style to copy into the span's built-in style

lv_spangroup_set_align

DEPRECATED. Use the text_align style property instead Set the align of the spangroup.

 
void lv_spangroup_set_align(lv_obj_t *obj, lv_text_align_t align)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a spangroup object.
alignlv_text_align_tsee lv_text_align_t for details.

lv_spangroup_set_overflow

Set the overflow of the spangroup.

 
void lv_spangroup_set_overflow(lv_obj_t *obj, lv_span_overflow_t overflow)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a spangroup object.
overflowlv_span_overflow_tsee lv_span_overflow_t for details.

lv_spangroup_set_indent

Set the indent of the spangroup.

 
void lv_spangroup_set_indent(lv_obj_t *obj, int32_t indent)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a spangroup object.
indentint32_tthe first line indentation

lv_spangroup_set_mode

DEPRECATED, set the width to LV_SIZE_CONTENT or fixed value to control expanding/wrapping" Set the mode of the spangroup.

 
void lv_spangroup_set_mode(lv_obj_t *obj, lv_span_mode_t mode)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a spangroup object.
modelv_span_mode_tsee lv_span_mode_t for details.

lv_spangroup_set_max_lines

Set maximum lines of the spangroup.

 
void lv_spangroup_set_max_lines(lv_obj_t *obj, int32_t lines)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a spangroup object.
linesint32_tmax lines that can be displayed in LV_SPAN_MODE_BREAK mode. < 0 means no limit.

Enums

lv_span_overflow_t

NameDescription
LV_SPAN_OVERFLOW_CLIP
LV_SPAN_OVERFLOW_ELLIPSIS
LV_SPAN_OVERFLOW_LASTFence member
Used by 1 function
  • lv_spangroup_set_overflow — param overflow

lv_span_mode_t

NameDescription
LV_SPAN_MODE_FIXEDfixed the obj size
LV_SPAN_MODE_EXPANDExpand the object size to the text size
LV_SPAN_MODE_BREAKKeep width, break the too long lines and expand height
LV_SPAN_MODE_LASTFence member
Used by 1 function
  • lv_spangroup_set_mode — param mode

_lv_property_span_id_t

NameValue
LV_PROPERTY_SPAN_ALIGN(LV_PROPERTY_SPAN_START + ((int) 0 )) | (( 1 ) << 28 )
LV_PROPERTY_SPAN_OVERFLOW(LV_PROPERTY_SPAN_START + ((int) 1 )) | (( 1 ) << 28 )
LV_PROPERTY_SPAN_INDENT(LV_PROPERTY_SPAN_START + ((int) 2 )) | (( 1 ) << 28 )
LV_PROPERTY_SPAN_MODE(LV_PROPERTY_SPAN_START + ((int) 3 )) | (( 1 ) << 28 )
LV_PROPERTY_SPAN_MAX_LINES(LV_PROPERTY_SPAN_START + ((int) 4 )) | (( 1 ) << 28 )
LV_PROPERTY_SPAN_END

Structs

struct

_lv_span_coords_t

Coords of a span

MemberTypeDescription
headinglv_area_t
middlelv_area_t
trailinglv_area_t

Typedefs

lv_span_coords_t

 
typedef struct _lv_span_coords_t lv_span_coords_t

Coords of a span

Variables

lv_spangroup_class

 
const lv_obj_class_t lv_spangroup_class

Dependencies

How is this guide?

Last updated on

On this page