lv_textarea.h
API reference for lv_textarea.h
Functions
lv_textarea_set_text
Set the text of a text area
void lv_textarea_set_text(lv_obj_t *obj, const char *txt)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
txt | const char * | pointer to the text |
lv_textarea_set_placeholder_text
Set the placeholder text of a text area
void lv_textarea_set_placeholder_text(lv_obj_t *obj, const char *txt)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
txt | const char * | pointer to the text |
lv_textarea_set_cursor_pos
Set the cursor position
void lv_textarea_set_cursor_pos(lv_obj_t *obj, int32_t pos)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
pos | int32_t | the new cursor position in character index < 0 : index from the end of the text LV_TEXTAREA_CURSOR_LAST: go after the last character |
lv_textarea_set_cursor_click_pos
Enable/Disable the positioning of the cursor by clicking the text on the text area.
void lv_textarea_set_cursor_click_pos(lv_obj_t *obj, bool en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
en | bool | true: enable click positions; false: disable |
lv_textarea_set_password_mode
Enable/Disable password mode
void lv_textarea_set_password_mode(lv_obj_t *obj, bool en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
en | bool | true: enable, false: disable |
lv_textarea_set_password_bullet
Set the replacement characters to show in password mode
void lv_textarea_set_password_bullet(lv_obj_t *obj, const char *bullet)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
bullet | const char * | pointer to the replacement text |
lv_textarea_set_one_line
Configure the text area to one line or back to normal
void lv_textarea_set_one_line(lv_obj_t *obj, bool en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
en | bool | true: one line, false: normal |
lv_textarea_set_accepted_chars
Set a list of characters. Only these characters will be accepted by the text area
void lv_textarea_set_accepted_chars(lv_obj_t *obj, const char *list)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
list | const char * | list of characters. A copy is saved. Example: "+-.,0123456789" |
lv_textarea_set_accepted_chars_static
Set a list of characters. Only these characters will be accepted by the text area
void lv_textarea_set_accepted_chars_static(lv_obj_t *obj, const char *list)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
list | const char * | list of characters. Only the pointer is saved. Example: "+-.,0123456789" |
lv_textarea_set_max_length
Set max length of a Text Area.
void lv_textarea_set_max_length(lv_obj_t *obj, uint32_t num)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
num | uint32_t | the maximal number of characters can be added (lv_textarea_set_text ignores it) |
lv_textarea_set_insert_replace
In LV_EVENT_INSERT the text which planned to be inserted can be replaced by another text. It can be used to add automatic formatting to the text area.
void lv_textarea_set_insert_replace(lv_obj_t *obj, const char *txt)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
txt | const char * | pointer to a new string to insert. If "" no text will be added. The variable must be live after the event_cb exists. (Should be global or static) |
lv_textarea_set_text_selection
Enable/disable selection mode.
void lv_textarea_set_text_selection(lv_obj_t *obj, bool en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
en | bool | true or false to enable/disable selection mode |
lv_textarea_set_password_show_time
Set how long show the password before changing it to '*'
void lv_textarea_set_password_show_time(lv_obj_t *obj, uint32_t time)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
time | uint32_t | show time in milliseconds. 0: hide immediately. |
lv_textarea_set_align
> Deprecated: Use the normal text_align style property instead Set the label's alignment. It sets where the label is aligned (in one line mode it can be smaller than the text area) and how the lines of the area align in case of multiline text area
void lv_textarea_set_align(lv_obj_t *obj, lv_text_align_t align)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a text area object |
align | lv_text_align_t | the align mode from lv_text_align_t |
Enums
_lv_property_textarea_id_t
| Name | Value |
|---|---|
LV_PROPERTY_TEXTAREA_TEXT | (LV_PROPERTY_TEXTAREA_START + ((int) 0 )) | (( 7 ) << 28 ) |
LV_PROPERTY_TEXTAREA_PLACEHOLDER_TEXT | (LV_PROPERTY_TEXTAREA_START + ((int) 1 )) | (( 7 ) << 28 ) |
LV_PROPERTY_TEXTAREA_CURSOR_POS | (LV_PROPERTY_TEXTAREA_START + ((int) 2 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TEXTAREA_CURSOR_CLICK_POS | (LV_PROPERTY_TEXTAREA_START + ((int) 3 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TEXTAREA_PASSWORD_MODE | (LV_PROPERTY_TEXTAREA_START + ((int) 4 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TEXTAREA_PASSWORD_BULLET | (LV_PROPERTY_TEXTAREA_START + ((int) 5 )) | (( 7 ) << 28 ) |
LV_PROPERTY_TEXTAREA_ONE_LINE | (LV_PROPERTY_TEXTAREA_START + ((int) 6 )) | (( 11 ) << 28 ) |
LV_PROPERTY_TEXTAREA_ACCEPTED_CHARS | (LV_PROPERTY_TEXTAREA_START + ((int) 7 )) | (( 7 ) << 28 ) |
LV_PROPERTY_TEXTAREA_MAX_LENGTH | (LV_PROPERTY_TEXTAREA_START + ((int) 8 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TEXTAREA_TEXT_SELECTION | (LV_PROPERTY_TEXTAREA_START + ((int) 9 )) | (( 11 ) << 28 ) |
LV_PROPERTY_TEXTAREA_PASSWORD_SHOW_TIME | (LV_PROPERTY_TEXTAREA_START + ((int) 10 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TEXTAREA_LABEL | (LV_PROPERTY_TEXTAREA_START + ((int) 11 )) | (( 8 ) << 28 ) |
LV_PROPERTY_TEXTAREA_TEXT_IS_SELECTED | (LV_PROPERTY_TEXTAREA_START + ((int) 12 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TEXTAREA_CURRENT_CHAR | (LV_PROPERTY_TEXTAREA_START + ((int) 13 )) | (( 1 ) << 28 ) |
LV_PROPERTY_TEXTAREA_END |
Macros
LV_TEXTAREA_CURSOR_LAST
#define LV_TEXTAREA_CURSOR_LAST (0x7FFF) /*Put the cursor after the last character*/LV_PART_TEXTAREA_PLACEHOLDER
#define LV_PART_TEXTAREA_PLACEHOLDER LV_PART_CUSTOM_FIRSTVariables
lv_textarea_class
const lv_obj_class_t lv_textarea_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_array.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_internal.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.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property.hlv_obj_property_names.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_observer.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