lv_span.h
API reference for lv_span.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)| Name | Type | Description |
|---|---|---|
span | lv_span_t * | pointer to a span. |
text | const 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,...)| Name | Type | Description |
|---|---|---|
span | lv_span_t * | pointer to a span. |
fmt | const 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)| Name | Type | Description |
|---|---|---|
span | lv_span_t * | pointer to a span. |
text | const 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a spangroup widget. |
span | lv_span_t * | pointer to a span. |
text | const 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a spangroup widget. |
span | lv_span_t * | pointer to a span. |
text | const 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,...)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a spangroup widget. |
span | lv_span_t * | pointer to a span. |
fmt | const 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer_to a spangroup |
span | lv_span_t * | pointer to a span. |
style | const 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a spangroup object. |
align | lv_text_align_t | see 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a spangroup object. |
overflow | lv_span_overflow_t | see 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a spangroup object. |
indent | int32_t | the 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a spangroup object. |
mode | lv_span_mode_t | see 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a spangroup object. |
lines | int32_t | max lines that can be displayed in LV_SPAN_MODE_BREAK mode. < 0 means no limit. |
Enums
lv_span_overflow_t
| Name | Description |
|---|---|
LV_SPAN_OVERFLOW_CLIP | |
LV_SPAN_OVERFLOW_ELLIPSIS | |
LV_SPAN_OVERFLOW_LAST | Fence member |
Used by 1 function
lv_spangroup_set_overflow— paramoverflow
lv_span_mode_t
| Name | Description |
|---|---|
LV_SPAN_MODE_FIXED | fixed the obj size |
LV_SPAN_MODE_EXPAND | Expand the object size to the text size |
LV_SPAN_MODE_BREAK | Keep width, break the too long lines and expand height |
LV_SPAN_MODE_LAST | Fence member |
Used by 1 function
lv_spangroup_set_mode— parammode
_lv_property_span_id_t
| Name | Value |
|---|---|
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
_lv_span_coords_t
Coords of a span
Typedefs
lv_span_coords_t
typedef struct _lv_span_coords_t lv_span_coords_tCoords of a span
Variables
lv_spangroup_class
const lv_obj_class_t lv_spangroup_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_array.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_kconfig.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_ll.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property_names.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_style_properties.hlv_symbol_def.hlv_text.hlv_tick.hlv_timer.hlv_types.h
How is this guide?
Last updated on