App:Library:LVGL:docs:Widgets:Label (lv label)
https://docs.lvgl.io/8.2/widgets/core/arc.html
Label (lv_label)
Overview
英文 | 自動翻訳 |
---|---|
A label is the basic object type that is used to display text. |
ラベルは、テキストを表示するために使用される基本的なオブジェクトタイプです。 |
Parts and Styles
英文 | 自動翻訳 |
---|---|
|
|
Usage
Set text
英文 | 自動翻訳 |
---|---|
You can set the text on a label at runtime with This will allocate a buffer dynamically, and the provided string will be copied into that buffer.
With
In this case, the text is not stored in the dynamic memory and the given buffer is used directly instead.
|
lv_label_set_text(label, "New text") を使用すると、実行時にラベルのテキストを設定することができます。
これは、動的にバッファを確保し、提供された文字列は、そのバッファにコピーされます。
|
Newline
英文 | 自動翻訳 |
---|---|
Newline characters are handled automatically by the label object.
|
改行文字はラベルオブジェクトによって自動的に処理されます。
|
Long modes
英文 | 自動翻訳 |
---|---|
By default, the width and height of the label is set to Therefore, the size of the label is automatically expanded to the text size.
Note that
The buffer you pass to |
デフォルトでは、ラベルの幅と高さはLV_SIZE_CONTENT に設定されています。
したがって、ラベルのサイズは、自動的にテキストサイズに拡大される。
|
Text recolor
英文 | 自動翻訳 |
---|---|
In the text, you can use commands to recolor parts of the text. For example: |
テキストでは、コマンドを使用してテキストの一部を再カラー化することができます。例えば "Write a #ff0000 red# word" 。この機能は、lv_label_set_recolor() 関数によって、ラベルごとに個別に有効にすることができます。
|
Text selection
英文 | 自動翻訳 |
---|---|
If enabled by
|
LV_LABEL_TEXT_SELECTION で有効にすると、テキストの一部を選択することができます。PCでマウスを使ってテキストを選択するのと同じような感じです。
|
Very long texts
英文 | 自動翻訳 |
---|---|
LVGL can efficiently handle very long (e.g. > 40k characters) labels by saving some extra data (~12 bytes) to speed up drawing. To enable this feature, set |
LVGLは、非常に長い(例えば、40k文字以上)ラベルを効率的に処理するために、いくつかの余分なデータ(〜12バイト)を保存して描画を高速化します。この機能を有効にするには、lv_conf.h で LV_LABEL_LONG_TXT_HINT を 1 に設定します。
|
Symbols
英文 | 自動翻訳 |
---|---|
The labels can display symbols alongside letters (or on their own). Read the Font section to learn more about the symbols. |
ラベルは、文字と一緒に(または単独で)記号を表示することができます。記号の詳細については、フォントのセクションをお読みください。 |
Events
英文 | 自動翻訳 |
---|---|
No special events are sent by the Label. See the events of the Base object too. Learn more about Events. |
Labelによって送信される特別なイベントはありません。
Baseオブジェクトのイベントも参照してください。 イベントの詳細を確認してください。 |
Keys
英文 | 自動翻訳 |
---|---|
No Keys are processed by the object type. Learn more about Keys. |
オブジェクトタイプによって処理されるキーはありません。
キーの詳細を確認してください。 |
Example
英文 | 自動翻訳 |
---|---|
Line wrap, recoloring and scrolling |
|
Text shadow |
|
Show LTR, RTL and Chinese texts |
|
Draw label with gradient color |
API
英文 | 自動翻訳 |
---|---|
Typedefs typedef uint8_t lv_label_long_mode_t Enums enum [anonymous]
Functions LV_EXPORT_CONST_INT(LV_LABEL_DOT_NUM) LV_EXPORT_CONST_INT(LV_LABEL_POS_LAST) LV_EXPORT_CONST_INT(LV_LABEL_TEXT_SELECTION_OFF) lv_obj_t *lv_label_create(lv_obj_t *parent)
void lv_label_set_text(lv_obj_t *obj, const char *text)
void lv_label_set_text_fmt (lv_obj_t *obj, const char *fmt,...) LV_FORMAT_ATTRIBUTE(2 void void lv_label_set_text_static (lv_obj_t *obj, const char *text)
void lv_label_set_long_mode(lv_obj_t *obj, lv_label_long_mode_t long_mode)
void lv_label_set_recolor(lv_obj_t *obj, bool en) void lv_label_set_text_sel_start(lv_obj_t *obj, uint32_t index)
void lv_label_set_text_sel_end(lv_obj_t *obj, uint32_t index)
char *lv_label_get_text(const lv_obj_t *obj)
lv_label_long_mode_t lv_label_get_long_mode(const lv_obj_t *obj)
bool lv_label_get_recolor(const lv_obj_t *obj)
void lv_label_get_letter_pos(const lv_obj_t *obj, uint32_t char_id, lv_point_t *pos)
uint32_t lv_label_get_letter_on(const lv_obj_t *obj, lv_point_t *pos_in)
bool lv_label_is_char_under_pos(const lv_obj_t *obj, lv_point_t *pos)
uint32_t lv_label_get_text_selection_start(const lv_obj_t *obj)
uint32_t lv_label_get_text_selection_end(const lv_obj_t *obj)
void lv_label_ins_text(lv_obj_t *obj, uint32_t pos, const char *txt)
void lv_label_cut_text(lv_obj_t *obj, uint32_t pos, uint32_t cnt)
Variables const lv_obj_class_t lv_label_class struct lv_label_t
|
typedef uint8_t lv_label_long_mode_t 列挙型 列挙型[匿名]
機能 LV_EXPORT_CONST_INT(LV_LABEL_DOT_NUM) LV_EXPORT_CONST_INT(LV_LABEL_POS_LAST) LV_EXPORT_CONST_INT(LV_LABEL_TEXT_SELECTION_OFF) lv_obj_t * lv_label_create(lv_obj_t * parent)
void lv_label_set_text(lv_obj_t * obj、const char * text)
void lv_label_set_text_fmt(lv_obj_t * obj、const char * fmt、...)LV_FORMAT_ATTRIBUTE(2 void void lv_label_set_text_static(lv_obj_t * obj、const char * text)
void lv_label_set_long_mode(lv_obj_t * obj、lv_label_long_mode_t long_mode)
void lv_label_set_recolor(lv_obj_t * obj、bool en) void lv_label_set_text_sel_start(lv_obj_t * obj、uint32_t index)
void lv_label_set_text_sel_end(lv_obj_t * obj、uint32_t index)
char * lv_label_get_text(const lv_obj_t * obj)
lv_label_long_mode_t lv_label_get_long_mode(const lv_obj_t * obj)
bool lv_label_get_recolor(const lv_obj_t * obj)
void lv_label_get_letter_pos(const lv_obj_t * obj、uint32_t char_id、lv_point_t * pos)
uint32_t lv_label_get_letter_on(const lv_obj_t * obj、lv_point_t * pos_in)
bool lv_label_is_char_under_pos(const lv_obj_t * obj、lv_point_t * pos)
uint32_t lv_label_get_text_selection_start(const lv_obj_t * obj)
uint32_t lv_label_get_text_selection_end(const lv_obj_t * obj)
void lv_label_ins_text(lv_obj_t * obj、uint32_t pos、const char * txt)
void lv_label_cut_text(lv_obj_t * obj、uint32_t pos、uint32_t cnt)
変数 const lv_obj_class_t lv_label_class struct lv_label_t
|