App:Library:LVGL:docs:Widgets:Drop-down list (lv dropdown)
https://docs.lvgl.io/8.2/widgets/core/arc.html
Drop-down list (lv_dropdown)
Overview
英文 | 自動翻訳 |
---|---|
The drop-down list allows the user to select one value from a list. The drop-down list is closed by default and displays a single value or a predefined text. When activated (by click on the drop-down list), a list is created from which the user may select one option. When the user selects a new value, the list is deleted again. The Drop-down list is added to the default group (if it is set). Besides the Drop-down list is an editable object to allow selecting an option with encoder navigation too. |
ドロップダウンリストを使用すると、ユーザーはリストから1つの値を選択できます。
ドロップダウンリストはデフォルトで閉じられており、単一の値または事前定義されたテキストが表示されます。(ドロップダウンリストをクリックして)アクティブ化すると、ユーザーが1つのオプションを選択できるリストが作成されます。ユーザーが新しい値を選択すると、リストは再び削除されます。 ドロップダウンリストがデフォルトグループに追加されます(設定されている場合)。ドロップダウンリストのほかに、エンコーダナビゲーションでオプションを選択できるようにする編集可能なオブジェクトがあります。 |
Parts and Styles
英文 | 自動翻訳 |
---|---|
The Dropdown widget is built from the elements: "button" and "list" (both not related to the button and list widgets) |
ドロップダウンウィジェットは、「ボタン」と「リスト」の要素から構築されています(どちらもボタンウィジェットとリストウィジェットには関係ありません)。 |
Button
英文 | 自動翻訳 |
---|---|
The button goes to when it's opened. |
ボタンが開くと |
List
英文 | 自動翻訳 |
---|---|
To add styles to it use
lv_obj_t * list = lv_dropdown_get_list(dropdown) /*Get the list*/ lv_obj_add_style(list, &my_style, ...) /*Add the styles to the list*/}` Alternatively the theme can be extended with the new styles. |
これにスタイルを追加するには、
lv_obj_t * list = lv_dropdown_get_list(dropdown)/*リストを取得*/ lv_obj_add_style(list、&my_style、...)/*スタイルをリストに追加*/} ` または、テーマを新しいスタイルで拡張することもできます。 |
Usage
Overview
Set options
英文 | 自動翻訳 |
---|---|
Options are passed to the drop-down list as a string with Options should be separated by For example:
The
You can select an option manually with |
オプションは、lv_dropdown_set_options(dropdown, options) の文字列としてドロップダウンリストに渡されます。
オプションは 例:
|
Get selected option
英文 | 自動翻訳 |
---|---|
The get the index of the selected option, use
|
選択されたオプションのインデックスを得るには、 lv_dropdown_get_selected(dropdown) を使用します。
|
Direction
英文 | 自動翻訳 |
---|---|
The list can be created on any side. The default If the list would be vertically out of the screen, it will be aligned to the edge. |
リストはどの側にも作成できる。デフォルトのLV_DIR_BOTTOM は lv_dropdown_set_dir(dropdown, LV_DIR_LEFT/RIGHT/UP/BOTTOM) 関数で変更することができる。
リストが垂直方向に画面からはみ出してしまう場合は、端に揃えるようにします。 |
Symbol
英文 | 自動翻訳 |
---|---|
A symbol (typically an arrow) can be added to the dropdown list with If the direction of the drop-down list is |
シンボル(通常は矢印)は、lv_dropdown_set_symbol(dropdown, LV_SYMBOL_...) でドロップダウン・リストに追加することができる。
ドロップダウン・リストの方向が |
Show selected
英文 | 自動翻訳 |
---|---|
The main part can either show the selected option or a static text. If a static is set with If the text is |
メインパートは、選択されたオプションか静的テキストを表示することができます。
text が |
Manually open/close
英文 | 自動翻訳 |
---|---|
To manually open or close the drop-down list the |
手動でドロップダウンリストを開いたり閉じたりするには, lv_dropdown_open/close(dropdown) 関数を使用します.
|
Events
英文 | 自動翻訳 |
---|---|
Apart from the Generic events, the following Special events are sent by the drop-down list:
Learn more about Events. |
一般的なイベントとは別に、ドロップダウン・リストから以下の特別なイベントが送信される。
イベントの詳細を確認してください。 |
Keys
英文 | 自動翻訳 |
---|---|
|
|
Example
英文 | 自動翻訳 |
---|---|
Simple Drop down list |
|
Drop down in four directions |
|
Menu |
API
英文 | 自動翻訳 |
---|---|
Functions LV_EXPORT_CONST_INT(LV_DROPDOWN_POS_LAST) lv_obj_t *lv_dropdown_create(lv_obj_t *parent)
void lv_dropdown_set_text(lv_obj_t *obj, const char *txt)
void lv_dropdown_set_options(lv_obj_t *obj, const char *options)
void lv_dropdown_set_options_static(lv_obj_t *obj, const char *options)
void lv_dropdown_add_option(lv_obj_t *obj, const char *option, uint32_t pos)
void lv_dropdown_clear_options(lv_obj_t *obj)
void lv_dropdown_set_selected(lv_obj_t *obj, uint16_t sel_opt)
void lv_dropdown_set_dir(lv_obj_t *obj, lv_dir_t dir)
void lv_dropdown_set_symbol(lv_obj_t *obj, const void *symbol)
void lv_dropdown_set_selected_highlight(lv_obj_t *obj, bool en)
lv_obj_t *lv_dropdown_get_list(lv_obj_t *obj)
const char *lv_dropdown_get_text(lv_obj_t *obj)
const char *lv_dropdown_get_options(const lv_obj_t *obj)
uint16_t lv_dropdown_get_selected(const lv_obj_t *obj)
uint16_t lv_dropdown_get_option_cnt(const lv_obj_t *obj)
void lv_dropdown_get_selected_str(const lv_obj_t *obj, char *buf, uint32_t buf_size)
const char *lv_dropdown_get_symbol(lv_obj_t *obj)
bool lv_dropdown_get_selected_highlight(lv_obj_t *obj)
lv_dir_t lv_dropdown_get_dir(const lv_obj_t *obj)
void lv_dropdown_open(lv_obj_t *dropdown_obj)
void lv_dropdown_close(lv_obj_t *obj)
bool lv_dropdown_is_open(lv_obj_t *obj)
Variables const lv_obj_class_t lv_dropdown_class const lv_obj_class_t lv_dropdownlist_class struct lv_dropdown_t
struct lv_dropdown_list_t
|
LV_EXPORT_CONST_INT(LV_DROPDOWN_POS_LAST) lv_obj_t * lv_dropdown_create(lv_obj_t * parent)
void lv_dropdown_set_text(lv_obj_t * obj、const char * txt)
void lv_dropdown_set_options(lv_obj_t * obj、const char * options)
void lv_dropdown_set_options_static(lv_obj_t * obj、const char * options)
void lv_dropdown_add_option(lv_obj_t * obj、const char * option、uint32_t pos)
void lv_dropdown_clear_options(lv_obj_t * obj)
void lv_dropdown_set_selected(lv_obj_t * obj、uint16_t sel_opt)
void lv_dropdown_set_dir(lv_obj_t * obj、lv_dir_t dir)
void lv_dropdown_set_symbol(lv_obj_t * obj、const void * symbol)
void lv_dropdown_set_selected_highlight(lv_obj_t * obj、bool en)
lv_obj_t * lv_dropdown_get_list(lv_obj_t * obj)
const char * lv_dropdown_get_text(lv_obj_t * obj)
const char * lv_dropdown_get_options(const lv_obj_t * obj)
uint16_t lv_dropdown_get_selected(const lv_obj_t * obj)
uint16_t lv_dropdown_get_option_cnt(const lv_obj_t * obj)
void lv_dropdown_get_selected_str(const lv_obj_t * obj、char * buf、uint32_t buf_size)
const char * lv_dropdown_get_symbol(lv_obj_t * obj)
bool lv_dropdown_get_selected_highlight(lv_obj_t * obj)
lv_dir_t lv_dropdown_get_dir(const lv_obj_t * obj)
void lv_dropdown_open(lv_obj_t * dropdown_obj)
void lv_dropdown_close(lv_obj_t * obj)
bool lv_dropdown_is_open(lv_obj_t * obj)
変数 const lv_obj_class_t lv_dropdown_class const lv_obj_class_t lv_dropdownlist_class struct lv_dropdown_t
struct lv_dropdown_list_t
|