lv_textarea.h

API reference for lv_textarea.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_textarea_private.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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
txtconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
txtconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
posint32_tthe 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
enbooltrue: 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
enbooltrue: 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
bulletconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
enbooltrue: 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
listconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
listconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
numuint32_tthe 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
txtconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
enbooltrue 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
timeuint32_tshow 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a text area object
alignlv_text_align_tthe align mode from lv_text_align_t

Enums

_lv_property_textarea_id_t

NameValue
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_FIRST

Variables

lv_textarea_class

 
const lv_obj_class_t lv_textarea_class

Dependencies

How is this guide?

Last updated on

On this page