App:Library:LVGL:docs:Widgets:Window (lv win)

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

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

Window (lv_win)

Overview

英文 自動翻訳

The Window is container-like object built from a header with title and buttons and a content area.

Windowは、タイトル、ボタン、およびコンテンツ領域を持つヘッダーから構築されたコンテナーのようなオブジェクトです。
戻る : Previous


Parts and Styles

英文 自動翻訳

The Window is built from other widgets so you can check their documentation for details:

  • Background: lv_obj
  • Header on the background: lv_obj
  • Title on the header: lv_label
  • Buttons on the header: lv_btn
  • Content area on the background: lv_obj
Windowは他のウィジェットから構築されているので、そのドキュメントで詳細を確認できます。
  • Background: lv_obj
  • Header on the background: lv_obj
  • Title on the header: lv_label
  • Buttons on the header: lv_btn
  • Content area on the background: lv_obj
戻る : Previous


Usage

Create a Window

英文 自動翻訳

lv_win_create(parent, header_height) creates a Window with an empty header.

lv_win_create(parent, header_height)は、空のヘッダを持つWindowを作成します。
戻る : Previous


Title and buttons

英文 自動翻訳

Any number of texts (but typically only one) can be added to the header with lv_win_add_title(win, "The title").


Control buttons can be added to the window's header with lv_win_add_btn(win, icon, btn_width).


icon can be any image source, and btn_width is the width of the button.


The title and the buttons will be added in the order the functions are called.


So adding a button, a text and two other buttons will result in a button on the left, a title, and 2 buttons on the right.


The width of the title is set to take all the remaining space on the header.


In other words: it pushes to the right all the buttons that are added after the title.

lv_win_add_title(win, "The title")を使用すると、任意の数のテキストをヘッダに追加することができます。


コントロールボタンは、lv_win_add_btn(win, icon, btn_width)でウィンドウのヘッダに追加することができます。


iconには任意のイメージソースを指定でき、btn_widthはボタンの幅です。


タイトルとボタンは、関数が呼び出された順序で追加されます。


ボタン、テキスト、その他2つのボタンを追加すると、左側にボタン、タイトル、右側に2つのボタンが表示されます。


タイトルの幅は、ヘッダーの残りのスペースをすべて取るように設定されます。


つまり、タイトルの後に追加されたすべてのボタンを右にプッシュします。

戻る : Previous


Get the parts

英文 自動翻訳

lv_win_get_header(win) returns a pointer to the header, lv_win_get_content(win) returns a pointer to the content container to which the content of the window can be added.

lv_win_get_header(win)はヘッダへのポインタを返し、lv_win_get_content(win)はウィンドウの内容を追加できる内容コンテナへのポインタを返します。
戻る : Previous


Events

英文 自動翻訳

No special events are sent by the windows, however events can be added manually to the return value of lv_win_add_btn.

Learn more about Events.

ウィンドウからは特別なイベントは送信されませんが、イベントはlv_win_add_btnの戻り値に手動で追加できます。

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

戻る : Previous


Keys

英文 自動翻訳

No Keys are handled by the window.

Learn more about Keys.

キーはウィンドウで処理されません。

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

戻る : Previous


Example

英文 自動翻訳

Simple window

LVGL docs example 117.png

戻る : Previous


API

英文 自動翻訳

Functions

lv_obj_t *lv_win_create(lv_obj_t *parent, lv_coord_t header_height)

lv_obj_t *lv_win_add_title(lv_obj_t *win, const char *txt)

lv_obj_t *lv_win_add_btn(lv_obj_t *win, const void *icon, lv_coord_t btn_w)

lv_obj_t *lv_win_get_header(lv_obj_t *win)

lv_obj_t *lv_win_get_content(lv_obj_t *win)

Variables

const lv_obj_class_t lv_win_class

struct lv_win_t

Public Members
lv_obj_t obj
Functions

lv_obj_t *lv_win_create(lv_obj_t *parent, lv_coord_t header_height)

lv_obj_t *lv_win_add_title(lv_obj_t *win, const char *txt)

lv_obj_t *lv_win_add_btn(lv_obj_t *win, const void *icon, lv_coord_t btn_w)

lv_obj_t *lv_win_get_header(lv_obj_t *win)

lv_obj_t *lv_win_get_content(lv_obj_t *win)

Variables

const lv_obj_class_t lv_win_class

struct lv_win_t

Public Members
lv_obj_t obj


戻る : Previous