「App:Library:LVGL:docs:Widgets:Base object」の版間の差分
(→Events) |
(→Events) |
||
415行目: | 415行目: | ||
**<code style="color: #bb0000;">rect_dsc</code> | **<code style="color: #bb0000;">rect_dsc</code> | ||
**<code style="color: #bb0000;">draw_area</code>:長方形の面積 | **<code style="color: #bb0000;">draw_area</code>:長方形の面積 | ||
− | + | *<code style="color: #bb0000;">LV_OBJ_DRAW_PART_BORDER_POST</code>style<code style="color: #bb0000;">border_post</code>プロパティが<code style="color: #bb0000;">true</code> | |
− | + | **<code style="color: #bb0000;">part</code>:<code style="color: #bb0000;">LV_PART_MAIN</code> | |
− | + | **<code style="color: #bb0000;">rect_dsc</code> | |
− | + | **<code style="color: #bb0000;">draw_area</code>:長方形の面積 | |
− | + | *<code style="color: #bb0000;">LV_OBJ_DRAW_PART_SCROLLBAR</code>スクロールバー | |
− | + | **<code style="color: #bb0000;">part</code>:<code style="color: #bb0000;">LV_PART_SCROLLBAR</code> | |
− | + | **<code style="color: #bb0000;">rect_dsc</code> | |
− | + | **<code style="color: #bb0000;">draw_area</code>:長方形の面積 | |
2022年6月29日 (水) 18:11時点における版
https://docs.lvgl.io/8.2/widgets/index.html
Base object (lv_obj)
Overview
英文 | 自動翻訳 |
---|---|
The 'Base Object' implements the basic properties of widgets on a screen, such as:
The functions and functionalities of the Base object can be used with other widgets too. For example
|
ベースオブジェクト」は、画面上のウィジェットの基本的なプロパティを実装したもので、次のようなものです。
Baseオブジェクトの関数と機能は、他のウィジェットでも使用できます。例:
<div>です。 |
Coordinates
英文 | 自動翻訳 |
---|---|
Only a small subset of coordinate settings is described here. To see all the features of LVGL (padding, coordinates in styles, layouts, etc) visit the Coordinates page. |
ここでは、座標設定のごく一部についてのみ説明します。LVGLのすべての機能(パディング、スタイルの座標、レイアウトなど)を確認するには、[座標]ページにアクセスしてください。 |
Size
英文 | 自動翻訳 |
---|---|
The object size can be modified on individual axes with |
オブジェクトのサイズは、lv_obj_set_width(obj, new_width) およびlv_obj_set_height(obj, new_height) を使用して個々の軸上で変更することも、lv_obj_set_size(obj, new_width, new_height) を使用して両方の軸を同時に変更することもできます。
|
Position
英文 | 自動翻訳 |
---|---|
You can set the position relative to the parent with |
親からの相対位置は、lv_obj_set_x(obj, new_x) とlv_obj_set_y(obj, new_y) 、またはlv_obj_set_pos(obj, new_x, new_y) を使用して同時に設定できます。
|
Alignment
英文 | 自動翻訳 |
---|---|
You can align the object on its parent with After this every x and y setting will be relative to the set alignment mode. For example, this will shift the object by 10;20 px from the center of its parent:
lv_obj_set_align(obj, LV_ALIGN_CENTER);
lv_obj_set_pos(obj, 10, 20);
//Or in one function
lv_obj_align(obj, LV_ALIGN_CENTER, 10, 20);
To align one object to another use:
|
lv_obj_set_align(obj, LV_ALIGN_...) で、オブジェクトをその親に位置合わせすることができます。
この後、すべての x と y の設定は、設定されたアライメントモードに対する相対的なものになります。 例えば、これはオブジェクトをその親の中心から 10;20 px ずらすことになります。
以下のアラインタイプが存在します。 (絵) |
Parents and children
英文 | 自動翻訳 |
---|---|
You can set a new parent for an object with To get the current parent, use
Some examples for
uint32_t i;
for(i = 0i < lv_obj_get_child_cnt(parent)i++) {
lv_obj_t * child = lv_obj_get_child(parent, i);
/*Do something with child*/
}
You can change the index of an object in its parent using
|
オブジェクトに新しい親を設定するには、 lv_obj_set_parent(obj, new_parent) を使います。
現在の親を取得するには、
uint32_t i ; for (i = 0 i < lv_obj_get_child_cnt (parent )i ++ ) { lv_obj_t * child = lv_obj_get_child (parent 、 i ); /*子供と何かをする*/ }
|
Display and Screens
英文 | 自動翻訳 |
---|---|
At the highest level of the LVGL object hierarchy is the display which represents the driver for a display device (physical display or simulator). A display can have one or more screens associated with it. Each screen contains a hierarchy of objects for graphical widgets representing a layout that covers the entire display.
The If you have multiple displays, it's important to know that the screen functions operate on the most recently created display or the one explicitly selected with
|
LVGLオブジェクト階層の最上位レベルには、ディスプレイデバイス (物理ディスプレイまたはシミュレータ) のドライバを表すディスプレイがあります。ディスプレイには、1つまたは複数の画面を関連付けることができます。各画面には、表示全体をカバーするレイアウトを表すグラフィカルウィジェットのオブジェクトの階層が含まれています。
複数のディスプレイを使用する場合、画面関数は最後に作成されたディスプレイ、または
|
Events
英文 | 自動翻訳 |
---|---|
To set an event callback for an object, use
Read the Event overview to learn more about events. |
オブジェクトにイベントコールバックを設定するには、lv_obj_add_event_cb(obj, event_cb, LV_EVENT_..., user_data) を使い、
イベントを手動でオブジェクトに送信するには、 イベントの詳細については、 「イベントの概要」 を参照してください。 |
Styles
英文 | 自動翻訳 |
---|---|
Be sure to read the Style overview. Here only the most essential functions are described.
The base objects use |
必ず「スタイルの概要」をお読みください。ここでは、最も重要な機能についてのみ説明します。
ベースオブジェクトは |
Flags
英文 | 自動翻訳 |
---|---|
/*Hide on object*/
lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN);
/*Make an object non-clickable*/
lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE);
/*Hide on object*/
lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN);
/*Make an object non-clickable*/
lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE);
|
/*オブジェクトを非表示にする*/
lv_obj_add_flag (obj 、 LV_OBJ_FLAG_HIDDEN );
/*オブジェクトをクリック不可にする*/
lv_obj_clear_flag (obj 、 LV_OBJ_FLAG_CLICKABLE );
いくつかの例: /*オブジェクトを非表示にする*/
lv_obj_add_flag (obj 、 LV_OBJ_FLAG_HIDDEN );
/*オブジェクトをクリック不可にする*/
lv_obj_clear_flag (obj 、 LV_OBJ_FLAG_CLICKABLE );
|
Groups
英文 | 自動翻訳 |
---|---|
Read the Input devices overview to learn more about Groups.
|
グループについての詳細は、入力デバイスの概要を参照してください。
オブジェクトは
|
Extended click area
英文 | 自動翻訳 |
---|---|
By default, the objects can be clicked only within their bounding area. However, this can be extended with |
デフォルトでは、オブジェクトは境界領域内でのみクリックできます。ただし、これは。lv_obj_set_ext_click_area(obj, size) で拡張できます。
|
Events
英文 | 自動翻訳 |
---|---|
Learn more about Events. |
|
Keys
英文 | 自動翻訳 |
---|---|
If If Learn more about Keys. |
LV_OBJ_FLAG_CHECKABLE が有効になっLV_KEY_RIGHT ている場合はLV_KEY_UP 、オブジェクトをオンにし、LV_KEY_LEFT オフLV_KEY_DOWN にします。
が有効になっているが、オブジェクトが編集可能でない場合(ウィジェットクラスで宣言されているように) 、 キーの詳細をご覧ください。 |
Example
Base objects with custom styles
英文 | 自動翻訳 |
---|---|
Make an object draggable |
API
英文 | 自動翻訳 |
---|---|
Typedefs typedef uint16_t lv_state_t typedef uint32_t lv_part_t typedef uint32_t lv_obj_flag_t typedef struct _lv_obj_t lv_obj_t Enums enum [anonymous]
enum [anonymous]
enum [anonymous]
enum lv_obj_draw_part_type_t
Functions void lv_init(void)
void lv_deinit(void)
bool lv_is_initialized(void)
lv_obj_t *lv_obj_create(lv_obj_t *parent)
void lv_obj_add_flag(lv_obj_t *obj, lv_obj_flag_t f)
void lv_obj_clear_flag(lv_obj_t *obj, lv_obj_flag_t f)
void lv_obj_add_state(lv_obj_t *obj, lv_state_t state)
void lv_obj_clear_state(lv_obj_t *obj, lv_state_t state)
static inline void lv_obj_set_user_data(lv_obj_t *obj, void *user_data)
bool lv_obj_has_flag(const lv_obj_t *obj, lv_obj_flag_t f)
bool lv_obj_has_flag_any(const lv_obj_t *obj, lv_obj_flag_t f)
lv_state_t lv_obj_get_state(const lv_obj_t *obj)
bool lv_obj_has_state(const lv_obj_t *obj, lv_state_t state)
void *lv_obj_get_group(const lv_obj_t *obj)
static inline void *lv_obj_get_user_data(lv_obj_t *obj)
void lv_obj_allocate_spec_attr(lv_obj_t *obj)
bool lv_obj_check_type(const lv_obj_t *obj, const lv_obj_class_t *class_p)
bool lv_obj_has_class(const lv_obj_t *obj, const lv_obj_class_t *class_p)
const lv_obj_class_t *lv_obj_get_class(const lv_obj_t *obj)
bool lv_obj_is_valid(const lv_obj_t *obj)
static inline lv_coord_t lv_obj_dpx(const lv_obj_t *obj, lv_coord_t n)
Variables const lv_obj_class_t lv_obj_class
struct _lv_obj_spec_attr_t
|
typedef uint16_t lv_state_t typedef uint32_t lv_part_t typedef uint32_t lv_obj_flag_t typedef struct _lv_obj_t lv_obj_t 列挙型 列挙型[匿名]
列挙型[匿名]
列挙型[匿名]
列挙型lv_obj_draw_part_type_t
機能 void lv_init(void)
void lv_deinit(void)
bool lv_is_initialized(void)
lv_obj_t * lv_obj_create(lv_obj_t * parent)
void lv_obj_add_flag(lv_obj_t * obj、lv_obj_flag_t f)
void lv_obj_clear_flag(lv_obj_t * obj、lv_obj_flag_t f)
void lv_obj_add_state(lv_obj_t * obj、lv_state_t state)
void lv_obj_clear_state(lv_obj_t * obj、lv_state_t state)
static inline void lv_obj_set_user_data(lv_obj_t * obj、void * user_data)
bool lv_obj_has_flag(const lv_obj_t * obj、lv_obj_flag_t f)
bool lv_obj_has_flag_any(const lv_obj_t * obj、lv_obj_flag_t f)
lv_state_t lv_obj_get_state(const lv_obj_t * obj)
bool lv_obj_has_state(const lv_obj_t * obj、lv_state_t state)
void * lv_obj_get_group(const lv_obj_t * obj)
static inline void * lv_obj_get_user_data(lv_obj_t * obj)
void lv_obj_allocate_spec_attr(lv_obj_t * obj)
bool lv_obj_check_type(const lv_obj_t * obj、const lv_obj_class_t * class_p)
bool lv_obj_has_class(const lv_obj_t * obj、const lv_obj_class_t * class_p)
const lv_obj_class_t * lv_obj_get_class(const lv_obj_t * obj)
bool lv_obj_is_valid(const lv_obj_t * obj)
静的インラインlv_coord_tlv_obj_dpx(const lv_obj_t * obj、lv_coord_t n)
変数 const lv_obj_class_t lv_obj_class
struct _lv_obj_spec_attr_t
struct _lv_obj_t
|