App:Library:LVGL:docs:Widgets:Tabview (lv tabview)

提供: robot-jp wiki
ナビゲーションに移動検索に移動

https://docs.lvgl.io/8.2/widgets/extra/tabview.html

Tabview (lv_tabview)

Overview

英文 自動翻訳

The Tab view object can be used to organize content in tabs. The Tab view is built from other widgets:

  • Main container: lv_obj)
    • Tab buttons: lv_btnmatrix
    • Container for the tabs: lv_obj
      • Content of the tabs: lv_obj

The tab buttons can be positioned on the top, bottom, left and right side of the Tab view.

A new tab can be selected either by clicking on a tab button or by sliding horizontally on the content.

タブビューオブジェクトは、コンテンツをタブで整理するために使用することができます。タブビューは、他のウィジェットから構築されています。
  • Main container: lv_obj)
    • Tab buttons: lv_btnmatrix
    • Container for the tabs: lv_obj
      • Content of the tabs: lv_obj

タブボタンは、タブビューの上下左右に配置することができます。

新しいタブの選択は、タブボタンをクリックするか、コンテンツ上を水平方向にスライドさせることで行います。

戻る : Previous


Parts and Styles

英文 自動翻訳

There are no special parts on the Tab view but the lv_obj and lv_btnnmatrix widgets are used to create the Tab view.

タブビューには特別な部分はありませんが、タブビューの作成にはlv_obj ウィジェットとlv_btnnmatrix ウィジェットが使用されます。
戻る : Previous


Usage

Create a Tab view

英文 自動翻訳

lv_tabview_create(parent, tab_pos, tab_size); creates a new empty Tab view.


tab_pos can be LV_DIR_TOP/BOTTOM/LEFT/RIGHT to position the tab buttons to a side.


tab_size is the height (in case of LV_DIR_TOP/BOTTOM) or width (in case of LV_DIR_LEFT/RIGHT) tab buttons.

lv_tabview_create(parent, tab_pos, tab_size);新しい空のタブビューが作成されます。

tab_pos は、タブボタンを横に配置するためにLV_DIR_TOP/BOTTOM/LEFT/RIGHTにすることができます。


tab_size は、タブボタンの高さ (LV_DIR_TOP/BOTTOMの場合) または幅 (LV_DIR_LEFT/RIGHTの場合) です。

戻る : Previous


Add tabs

英文 自動翻訳

New tabs can be added with lv_tabview_add_tab(tabview, "Tab name").

This will return a pointer to an lv_obj object where the tab's content can be created.

新しいタブを追加するにはlv_tabview_add_tab(tabview, "Tab name")を使用します。

これは、タブのコンテンツを作成できるlv_objオブジェクトへのポインターを返します。

戻る : Previous


Change tab

英文 自動翻訳

To select a new tab you can:

  • Click on its tab button
  • Slide horizontally
  • Use lv_tabview_set_act(tabview, id, LV_ANIM_ON/OFF) function
新しいタブを選択するには、次の操作を行います。
  • タブボタンをクリックする
  • 水平方向にスライド
  • lv_tabview_set_act(tabview, id, LV_ANIM_ON/OFF) 関数を使用します。
戻る : Previous


Get the parts

英文 自動翻訳

lv_tabview_get_content(tabview) returns the container for the tabs, lv_tabview_get_tab_btns(tabview) returns the Tab buttons object which is a Button matrix.

lv_tabview_get_content(tabview) はタブのコンテナを返し、 lv_tabview_get_tab_btns(tabview)はボタン行列であるタブボタンオブジェクトを返します。
戻る : Previous


Events

英文 自動翻訳
  • LV_EVENT_VALUE_CHANGED Sent when a new tab is selected by sliding or clicking the tab button. lv_tabview_get_tab_act(tabview) returns the zero based index of the current tab.


Learn more about Events.

  • LV_EVENT_VALUE_CHANGED スライドやタブボタンのクリックで新しいタブが選択されたときに送られます。 lv_tabview_get_tab_act(tabview)は現在のタブのゼロベースのインデックスを返します。


イベントの詳細を確認してください。

戻る : Previous


Keys

英文 自動翻訳

Keys have effect only on the tab buttons (Button matrix). Add manually to a group if required.

Learn more about Keys.

キーは、タブボタン (ボタンマトリックス) に対してのみ有効です。必要に応じて、グループに手動で追加します。

キーの詳細を確認してください。

戻る : Previous


Example

英文 自動翻訳

Simple Tabview

LVGL docs example 111.png

Tabs on the left, styling and no scrolling

LVGL docs example 112.png|

戻る : Previous


API

英文 自動翻訳

Functions

lv_obj_t *lv_tabview_create(lv_obj_t *parent, lv_dir_t tab_pos, lv_coord_t tab_size)

lv_obj_t *lv_tabview_add_tab(lv_obj_t *tv, const char *name)

lv_obj_t *lv_tabview_get_content(lv_obj_t *tv)

lv_obj_t *lv_tabview_get_tab_btns(lv_obj_t *tv)

void lv_tabview_set_act(lv_obj_t *obj, uint32_t id, lv_anim_enable_t anim_en)

uint16_t lv_tabview_get_tab_act(lv_obj_t *tv)

Variables

const lv_obj_class_t lv_tabview_class

struct lv_tabview_t

Public Members
lv_obj_t obj
char **map
uint16_t tab_cnt
uint16_t tab_cur
lv_dir_t tab_pos
Functions

lv_obj_t *lv_tabview_create(lv_obj_t *parent, lv_dir_t tab_pos, lv_coord_t tab_size)

lv_obj_t *lv_tabview_add_tab(lv_obj_t *tv, const char *name)

lv_obj_t *lv_tabview_get_content(lv_obj_t *tv)

lv_obj_t *lv_tabview_get_tab_btns(lv_obj_t *tv)

void lv_tabview_set_act(lv_obj_t *obj, uint32_t id, lv_anim_enable_t anim_en)

uint16_t lv_tabview_get_tab_act(lv_obj_t *tv)

Variables

const lv_obj_class_t lv_tabview_class

struct lv_tabview_t

Public Members
lv_obj_t obj
char **map
uint16_t tab_cnt
uint16_t tab_cur
lv_dir_t tab_pos


戻る : Previous