App:Library:LVGL:docs:Widgets:Text area (lv textarea)
https://docs.lvgl.io/8.2/widgets/core/arc.html
Text area (lv_textarea)
Overview
英文 | 自動翻訳 |
---|---|
The Text Area is a Base object with a Label and a cursor on it. Texts or characters can be added to it. Long lines are wrapped and when the text becomes long enough the Text area can be scrolled. One line mode and password modes are supported. |
テキストエリアは、ラベルとカーソルが描かれたベースオブジェクトです。
テキストや文字は、そこに追加することができます。 長い行は折り返され、十分な長さになるとテキストエリアはスクロールすることができます。 1行モードとパスワードモードに対応しています。 |
Parts and Styles
英文 | 自動翻訳 |
---|---|
|
|
Usage
Add text
英文 | 自動翻訳 |
---|---|
You can insert text or characters to the current cursor's position with:
To add wide characters like
|
現在のカーソル位置にテキストまたは文字を挿入するには、次のようにします。
'á'、'ß'、またはCJK文字のようなワイド文字を追加するには、lv_textarea_add_text (タ、"á")を使用します。 lv_textarea_set_text (ta 「新しいテキスト」)は、テキスト全体を変更します。 |
Placeholder
英文 | 自動翻訳 |
---|---|
A placeholder text can be specified - which is displayed when the Text area is empty - with |
テキストエリアが空の時に表示されるプレースホルダテキストを指定するには、lv_textarea_set_placeholder_text(ta, "Placeholder text") を使用します。
|
Delete character
英文 | 自動翻訳 |
---|---|
To delete a character from the left of the current cursor position use |
現在のカーソル位置の左側から文字を削除するには lv_textarea_del_char(textarea) を使用します。右から削除するには lv_textarea_del_char_forward(textarea) を使用します。
|
Move the cursor
英文 | 自動翻訳 |
---|---|
The cursor position can be modified directly like You can step the cursor with
|
カーソル位置はlv_textarea_set_cursor_pos(textarea, 10) のように直接変更することができます。0 の位置は "最初の文字の前"、LV_TA_CURSOR_LAST は "最後の文字の後 "を意味します。
カーソルをステップさせるには
|
Hide the cursor
英文 | 自動翻訳 |
---|---|
The cursor is always visible, however it can be a good idea to style it to be visible only in |
カーソルは常に表示されますが、LV_STATE_FOCUSED 状態でのみ表示されるようにスタイルを設定するのもよいアイデアです。
|
One line mode
英文 | 自動翻訳 |
---|---|
The Text area can be configured to be on a single line with In this mode the height is set automatically to show only one line, line break characters are ignored, and word wrap is disabled. |
テキストエリアは lv_textarea_set_one_line(textarea, true) で1行に表示するように設定することができます。
このモードでは、高さは1行だけ表示されるように自動的に設定され、改行文字は無視され、ワードラップは無効にされます。 |
Password mode
英文 | 自動翻訳 |
---|---|
The text area supports password mode which can be enabled with If the If In password mode The visibility time can be adjusted with |
テキストエリアはパスワードモードに対応しており、 lv_textarea_set_password_mode(textarea, true) で有効にすることができます。
フォント内に - (Bullet, U+2022) 文字が存在する場合、入力された文字はしばらくしてから、または新しい文字が入力されたときに、この文字に変換されます。 もし
表示時間は |
Accepted characters
英文 | 自動翻訳 |
---|---|
You can set a list of accepted characters with |
lv_textarea_set_accepted_chars(textarea, "0123456789.+-") で、受け入れられる文字のリストを設定することができます。それ以外の文字は無視されます。
|
Max text length
英文 | 自動翻訳 |
---|---|
The maximum number of characters can be limited with |
最大文字数はlv_textarea_set_max_length(textarea, max_char_num) で制限することができます。
|
Very long texts
英文 | 自動翻訳 |
---|---|
If there is a very long text in the Text area (e.g. > 20k characters), scrolling and drawing might be slow. However, by enabling This will save some additional information about the label to speed up its drawing. Using |
Textエリアに非常に長いテキストがある場合(例:20k文字以上)、スクロールや描画が遅くなることがあります。しかし、lv_conf.h で LV_LABEL_LONG_TXT_HINT を1にして有効にすると、パフォーマンスが大幅に改善されます。
これは、ラベルに関するいくつかの追加情報を保存し、その描画を高速化するものです。 |
Select text
英文 | 自動翻訳 |
---|---|
Any part of the text can be selected if enabled with This works much like when you select text on your PC with your mouse. |
lv_textarea_set_text_selection(textarea, true) で有効にすると、テキストのどの部分でも選択できるようになります。
これは、PCでマウスを使ってテキストを選択するときと同じように動作します。 |
Events
英文 | 自動翻訳 |
---|---|
Learn more about Events. |
イベントの詳細を確認してください。 |
Keys
英文 | 自動翻訳 |
---|---|
|
|
Example
英文 | 自動翻訳 |
---|---|
Simple Text area |
|
Text area with password field |
|
Text auto-formatting |
API
英文 | 自動翻訳 |
---|---|
Enums enum [anonymous]
Functions LV_EXPORT_CONST_INT(LV_TEXTAREA_CURSOR_LAST) lv_obj_t *lv_textarea_create(lv_obj_t *parent)
void lv_textarea_add_char(lv_obj_t *obj, uint32_t c)
void lv_textarea_add_text(lv_obj_t *obj, const char *txt)
void lv_textarea_del_char(lv_obj_t *obj)
void lv_textarea_del_char_forward(lv_obj_t *obj)
void lv_textarea_set_text(lv_obj_t *obj, const char *txt)
void lv_textarea_set_placeholder_text(lv_obj_t *obj, const char *txt)
void lv_textarea_set_cursor_pos(lv_obj_t *obj, int32_t pos)
void lv_textarea_set_cursor_click_pos(lv_obj_t *obj, bool en)
void lv_textarea_set_password_mode(lv_obj_t *obj, bool en)
void lv_textarea_set_one_line(lv_obj_t *obj, bool en)
void lv_textarea_set_accepted_chars(lv_obj_t *obj, const char *list)
void lv_textarea_set_max_length(lv_obj_t *obj, uint32_t num)
void lv_textarea_set_insert_replace(lv_obj_t *obj, const char *txt)
void lv_textarea_set_text_selection(lv_obj_t *obj, bool en)
void lv_textarea_set_password_show_time(lv_obj_t *obj, uint16_t time)
void lv_textarea_set_align(lv_obj_t *obj, lv_text_align_t align)
const char *lv_textarea_get_text(const lv_obj_t *obj)
const char *lv_textarea_get_placeholder_text(lv_obj_t *obj)
lv_obj_t *lv_textarea_get_label(const lv_obj_t *obj)
uint32_t lv_textarea_get_cursor_pos(const lv_obj_t *obj)
bool lv_textarea_get_cursor_click_pos(lv_obj_t *obj)
bool lv_textarea_get_password_mode(const lv_obj_t *obj)
bool lv_textarea_get_one_line(const lv_obj_t *obj)
const char *lv_textarea_get_accepted_chars(lv_obj_t *obj)
uint32_t lv_textarea_get_max_length(lv_obj_t *obj)
bool lv_textarea_text_is_selected(const lv_obj_t *obj)
bool lv_textarea_get_text_selection(lv_obj_t *obj)
uint16_t lv_textarea_get_password_show_time(lv_obj_t *obj)
void lv_textarea_clear_selection(lv_obj_t *obj)
void lv_textarea_cursor_right(lv_obj_t *obj)
void lv_textarea_cursor_left(lv_obj_t *obj)
void lv_textarea_cursor_down(lv_obj_t *obj)
void lv_textarea_cursor_up(lv_obj_t *obj)
Variables const lv_obj_class_t lv_textarea_class struct lv_textarea_t
|
Enums
enum [anonymous]
Functions LV_EXPORT_CONST_INT(LV_TEXTAREA_CURSOR_LAST) lv_obj_t *lv_textarea_create(lv_obj_t *parent)
void lv_textarea_add_char(lv_obj_t *obj, uint32_t c)
void lv_textarea_add_text(lv_obj_t *obj, const char *txt)
void lv_textarea_del_char(lv_obj_t *obj)
void lv_textarea_del_char_forward(lv_obj_t *obj)
void lv_textarea_set_text(lv_obj_t *obj, const char *txt)
void lv_textarea_set_placeholder_text(lv_obj_t *obj, const char *txt)
void lv_textarea_set_cursor_pos(lv_obj_t *obj, int32_t pos)
void lv_textarea_set_cursor_click_pos(lv_obj_t *obj, bool en)
void lv_textarea_set_password_mode(lv_obj_t *obj, bool en)
void lv_textarea_set_one_line(lv_obj_t *obj, bool en)
void lv_textarea_set_accepted_chars(lv_obj_t *obj, const char *list)
void lv_textarea_set_max_length(lv_obj_t *obj, uint32_t num)
void lv_textarea_set_insert_replace(lv_obj_t *obj, const char *txt)
void lv_textarea_set_text_selection(lv_obj_t *obj, bool en)
void lv_textarea_set_password_show_time(lv_obj_t *obj, uint16_t time)
void lv_textarea_set_align(lv_obj_t *obj, lv_text_align_t align)
const char *lv_textarea_get_text(const lv_obj_t *obj)
const char *lv_textarea_get_placeholder_text(lv_obj_t *obj)
lv_obj_t *lv_textarea_get_label(const lv_obj_t *obj)
uint32_t lv_textarea_get_cursor_pos(const lv_obj_t *obj)
bool lv_textarea_get_cursor_click_pos(lv_obj_t *obj)
bool lv_textarea_get_password_mode(const lv_obj_t *obj)
bool lv_textarea_get_one_line(const lv_obj_t *obj)
const char *lv_textarea_get_accepted_chars(lv_obj_t *obj)
uint32_t lv_textarea_get_max_length(lv_obj_t *obj)
bool lv_textarea_text_is_selected(const lv_obj_t *obj)
bool lv_textarea_get_text_selection(lv_obj_t *obj)
uint16_t lv_textarea_get_password_show_time(lv_obj_t *obj)
void lv_textarea_clear_selection(lv_obj_t *obj)
void lv_textarea_cursor_right(lv_obj_t *obj)
void lv_textarea_cursor_left(lv_obj_t *obj)
void lv_textarea_cursor_down(lv_obj_t *obj)
void lv_textarea_cursor_up(lv_obj_t *obj)
Variables const lv_obj_class_t lv_textarea_class struct lv_textarea_t
|