「App:Library:LVGL:docs:Widgets:Base object」の版間の差分
51行目: | 51行目: | ||
Base オブジェクトは、単純なウィジェットとして直接使用できます。 長方形に他なりません。 | Base オブジェクトは、単純なウィジェットとして直接使用できます。 長方形に他なりません。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
111行目: | 111行目: | ||
レイアウトまたは自動調整が他のウィジェットで使用されている場合、マージンとパディングが重要になります。 | レイアウトまたは自動調整が他のウィジェットで使用されている場合、マージンとパディングが重要になります。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
123行目: | 123行目: | ||
|親からの相対位置は、<code style="color: #bb0000;">lv_obj_set_x(obj, new_x)</code>と<code style="color: #bb0000;">lv_obj_set_y(obj, new_y)</code>、または<code style="color: #bb0000;">lv_obj_set_pos(obj, new_x, new_y)</code>を使用して同時に設定できます。 | |親からの相対位置は、<code style="color: #bb0000;">lv_obj_set_x(obj, new_x)</code>と<code style="color: #bb0000;">lv_obj_set_y(obj, new_y)</code>、または<code style="color: #bb0000;">lv_obj_set_pos(obj, new_x, new_y)</code>を使用して同時に設定できます。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
142行目: | 142行目: | ||
* 3 番目の引数は、配置のタイプです。 可能なオプションは次のとおりです。 | * 3 番目の引数は、配置のタイプです。 可能なオプションは次のとおりです。 | ||
|- | |- | ||
− | | colspan="2" |[[ | + | | colspan="2" |[[file:LVGL Lib docs obj.png|link=https://docs.lvgl.io/latest/en/html/widgets/obj.html#base-objects-with-custom-styles]] |
|- | |- | ||
| | | | ||
204行目: | 204行目: | ||
'''画面の座標は変更できないことに注意してください。 これらの関数を画面で使用しようとすると、未定義の動作が発生します。''' | '''画面の座標は変更できないことに注意してください。 これらの関数を画面で使用しようとすると、未定義の動作が発生します。''' | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
242行目: | 242行目: | ||
<code style="color: #bb0000;">lv_obj_count_children_recursive(obj)</code> も子の数を示しますが、子の子を再帰的にカウントします。 | <code style="color: #bb0000;">lv_obj_count_children_recursive(obj)</code> も子の数を示しますが、子の子を再帰的にカウントします。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
271行目: | 271行目: | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
324行目: | 324行目: | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
344行目: | 344行目: | ||
イベントの詳細については、 「イベントの概要」 を参照してください。 | イベントの詳細については、 「イベントの概要」 を参照してください。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
368行目: | 368行目: | ||
イベントの詳細については、イベントの概要をご覧ください。 | イベントの詳細については、イベントの概要をご覧ください。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
=== States === | === States === | ||
392行目: | 392行目: | ||
パーツの詳細については、スタイルの概要の関連セクションをお読みください。 | パーツの詳細については、スタイルの概要の関連セクションをお読みください。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
431行目: | 431行目: | ||
オブジェクトで既に使用されているスタイルを変更する場合、影響を受けるオブジェクトを更新するには、それを使用する各オブジェクトで <code style="color: #bb0000;">lv_obj_refresh_style(obj)</code> を使用するか、指定されたスタイルを持つすべてのオブジェクトに <code style="color: #bb0000;">lv_obj_report_style_mod(&style)</code>を使用して通知します。 <code style="color: #bb0000;">lv_obj_report_style_mod</code>のパラメーターが <code style="color: #bb0000;">NULL</code> の場合、すべてのオブジェクトが通知されます。 | オブジェクトで既に使用されているスタイルを変更する場合、影響を受けるオブジェクトを更新するには、それを使用する各オブジェクトで <code style="color: #bb0000;">lv_obj_refresh_style(obj)</code> を使用するか、指定されたスタイルを持つすべてのオブジェクトに <code style="color: #bb0000;">lv_obj_report_style_mod(&style)</code>を使用して通知します。 <code style="color: #bb0000;">lv_obj_report_style_mod</code>のパラメーターが <code style="color: #bb0000;">NULL</code> の場合、すべてのオブジェクトが通知されます。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
462行目: | 462行目: | ||
* opa_scale_enable - 不透明度のスケーリングを有効にします。 [#opa-scale](オパ スケール) セクションを参照してください。 | * opa_scale_enable - 不透明度のスケーリングを有効にします。 [#opa-scale](オパ スケール) セクションを参照してください。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
501行目: | 501行目: | ||
<code style="color: #bb0000;">lv_obj_add/clear_protect(obj, LV_PROTECT_...)</code> は、保護を設定/クリアします。保護タイプの「OR」値も使用できます。 | <code style="color: #bb0000;">lv_obj_add/clear_protect(obj, LV_PROTECT_...)</code> は、保護を設定/クリアします。保護タイプの「OR」値も使用できます。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
526行目: | 526行目: | ||
グループの詳細については、入力デバイスの概要をご覧ください。 | グループの詳細については、入力デバイスの概要をご覧ください。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
559行目: | 559行目: | ||
* LV_EXT_CLICK_AREA_OFF この機能を無効にする | * LV_EXT_CLICK_AREA_OFF この機能を無効にする | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
577行目: | 577行目: | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
595行目: | 595行目: | ||
詳細は[[App:Library:LVGL:docs:Overview:Input devices|'''<u>Keys</u>''']]をご覧ください。 | 詳細は[[App:Library:LVGL:docs:Overview:Input devices|'''<u>Keys</u>''']]をご覧ください。 | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
604行目: | 604行目: | ||
|[[file:LVGL Lib docs BaseObj.png|link=https://docs.lvgl.io/latest/en/html/widgets/obj.html#base-objects-with-custom-styles]] | |[[file:LVGL Lib docs BaseObj.png|link=https://docs.lvgl.io/latest/en/html/widgets/obj.html#base-objects-with-custom-styles]] | ||
|} | |} | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
== [https://docs.lvgl.io/latest/en/html/widgets/obj.html#api API] == | == [https://docs.lvgl.io/latest/en/html/widgets/obj.html#api API] == | ||
610行目: | 610行目: | ||
− | :[[App:Library:LVGL | + | :[[App:Library:LVGL:docs:Widgets|戻る : Previous]] |
2022年8月31日 (水) 21:20時点における最新版
https://docs.lvgl.io/latest/en/html/widgets/obj.html
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:
In object-oriented thinking, it is the base class from which all other objects in LVGL are inherited. This, among another things, helps reduce code duplication. The functions and functionalities of Base object can be used with other widgets too. For example
|
ベースオブジェクト」は、画面上のウィジェットの基本的なプロパティを実装したもので、次のようなものです。
オブジェクト指向の考え方では、LVGL の他のすべてのオブジェクトが継承される基本クラスです。 これはコードの重複を減らすのに役立ちます。
Base オブジェクトの関数と機能は、他のウィジェットでも使用できます。 例えば
Base オブジェクトは、単純なウィジェットとして直接使用できます。 長方形に他なりません。 |
Coordinates
Size
英文 | 自動翻訳 |
---|---|
The object size can be modified on individual axes with
Styles can add Padding to the object as well. Padding means "I don't want my children too close to my sides, so keep this space". To set width or height reduced by the padding In a more exact way: To get the width or height which is REDUCED by padding use It can be considered the "useful size of the object".
Margin and padding gets important when Layout or Auto-fit is used by other widgets. |
オブジェクトのサイズは、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
Parents and children
英文 | 自動翻訳 |
---|---|
You can set a new parent for an object with lv_obj_set_parent(obj, new_parent) .
To get the current parent, use To get the children of an object, use |
lv_obj_set_parent(obj, new_parent) を使用して、オブジェクトの新しい親を設定できます。
現在の親を取得するには、
|
lv_obj_t * child = lv_obj_get_child(parent, NULL);
while(child) {
/*Do something with "child" */
child = lv_obj_get_child(parent, child);
}
| |
lv_obj_get_index(obj) tells the number of children on an object.
It is equivalent to the number of younger children in the parent.
|
lv_obj_get_index(obj) は、オブジェクトの子の数を示します。
これは、親の年少の子供の数に相当します。
|
Screens
英文 | 自動翻訳 |
---|---|
When you have created a screen like The
If you have more display then it's important to know that these functions operate on the lastly created or the explicitly selected (with
|
lv_obj_t * screen = lv_obj_create(NULL, NULL) のように画面を作成したら、lv_scr_load(screen) で読み込むことができます。
|
Layers
英文 | 自動翻訳 |
---|---|
There are two automatically generated layers:
The top layer is above every object on the screen and the system layer is above the top layer too. You can add any pop-up windows to the top layer freely. But, the system layer is restricted to system-level things (e.g. mouse cursor will be placed here in
|
2 つの自動生成レイヤーがあります。
最上層に任意のポップアップ ウィンドウを自由に追加できます。 ただし、システム レイヤーはシステム レベルのものに制限されます (たとえば、マウス カーソルは
|
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) を使い、
イベントを手動でオブジェクトに送信するには、 イベントの詳細については、 「イベントの概要」 を参照してください。 |
Parts
英文 | 自動翻訳 |
---|---|
To set an event callback for an object, use lv_obj_set_event_cb(obj, event_cb) ,
|
オブジェクトのイベント コールバックを設定するには、lv_obj_set_event_cb(obj, event_cb) を使用します。
イベントの詳細については、イベントの概要をご覧ください。 |
States
英文 | 自動翻訳 |
---|---|
The widgets can have multiple parts. For example a Button has only a main part but a Slider is built from a background, an indicator and a knob.
|
ウィジェットには複数のパーツを含めることができます。 たとえば、ボタンには主要な部分しかありませんが、スライダーは背景、インジケーター、およびノブから構築されます。
|
Styles
英文 | 自動翻訳 |
---|---|
Be sure to read the Style overview first.
The Base object use all the rectangle-like style properties.
If the parameter of |
最初に必ずスタイルの概要をお読みください。
Base オブジェクトは、すべての長方形のようなスタイル プロパティを使用します。
オブジェクトからすべてのスタイルを削除するには、
|
Attributes
英文 | 自動翻訳 |
---|---|
There are some attributes which can be enabled/disabled by lv_obj_set_...(obj, true/false) :
|
lv_obj_set_...(obj, true/false) で有効/無効にできる属性がいくつかあります:
|
Protect
英文 | 自動翻訳 |
---|---|
There are some specific actions which happen automatically in the library.
To prevent one or more that kind of actions, you can protect the object against them. The following protections exists:
|
ライブラリで自動的に発生する特定のアクションがいくつかあります。
そのようなアクションを 1 つ以上防止するために、オブジェクトをそれらから保護することができます。 次の保護が存在します。
|
Groups
英文 | 自動翻訳 |
---|---|
Once, an object is added to group with
|
オブジェクトが lv_group_add_obj(group, obj) でグループに追加されると、オブジェクトの現在のグループは lv_obj_get_group(obj) で取得できます。
グループの詳細については、入力デバイスの概要をご覧ください。 |
Extended click area
英文 | 自動翻訳 |
---|---|
By default, the objects can be clicked only on their coordinates, however, this area can be extended with
The possible values are:
|
デフォルトでは、オブジェクトは座標上でのみクリックできますが、この領域はv_obj_set_ext_click_area(obj, left, right, top, bottom) で拡張できます。
可能な値は次のとおりです。
|
Events
英文 | 自動翻訳 |
---|---|
Only the Generic events are sent by the object type.
|
オブジェクト タイプによって送信されるのは Generic events のみです。
詳細はEventsをご覧ください。 |
Keys
英文 | 自動翻訳 |
---|---|
No Keys are processed by the object type.
|
オブジェクト タイプによって処理されるキーはありません。
|