「App:Library:LVGL:docs:Widgets:Base object」の版間の差分
25行目: | 25行目: | ||
This, among another things, helps reduce code duplication. | This, among another things, helps reduce code duplication. | ||
− | The functions and functionalities of Base object can be used with other widgets too. For example <code>lv_obj_set_width(slider, 100)</code> | + | The functions and functionalities of Base object can be used with other widgets too. For example <code style="color: #bb0000;">lv_obj_set_width(slider, 100)</code> |
63行目: | 63行目: | ||
− | Styles can add Margin to the objects. Margin tells that "I want this space around me". To set width or height reduced by the margin <code>lv_obj_set_width_margin(obj, new_width)</code> or <code>lv_obj_set_height_margin(obj, new_height)</code>. In more exact way: <code>new_width = left_margin + object_width + right_margin</code>. | + | Styles can add Margin to the objects. Margin tells that "I want this space around me". To set width or height reduced by the margin <code style="color: #bb0000;">lv_obj_set_width_margin(obj, new_width)</code> or <code style="color: #bb0000;">lv_obj_set_height_margin(obj, new_height)</code>. In more exact way: <code style="color: #bb0000;">new_width = left_margin + object_width + right_margin</code>. |
− | To get the width or height which includes the margins use <code>lv_obj_get_width/height_margin(obj)</code>. | + | To get the width or height which includes the margins use <code style="color: #bb0000;">lv_obj_get_width/height_margin(obj)</code>. |
− | 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 <code>lv_obj_set_width_fit(obj, new_width)</code> or <code>lv_obj_set_height_fit(obj, new_height)</code>. | + | 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 <code style="color: #bb0000;">lv_obj_set_width_fit(obj, new_width)</code> or <code style="color: #bb0000;">lv_obj_set_height_fit(obj, new_height)</code>. |
− | In a more exact way: <code>new_width = left_pad + object_width + right_pad</code> To get the width or height which is REDUCED by padding use <code>lv_obj_get_width/height_fit(obj)</code>. It can be considered the "useful size of the object". | + | In a more exact way: <code style="color: #bb0000;">new_width = left_pad + object_width + right_pad</code> To get the width or height which is REDUCED by padding use <code style="color: #bb0000;">lv_obj_get_width/height_fit(obj)</code>. It can be considered the "useful size of the object". |
111行目: | 111行目: | ||
!自動翻訳 | !自動翻訳 | ||
|- | |- | ||
− | |You can align the object to another with <code>lv_obj_align(obj, obj_ref, LV_ALIGN_..., x_ofs, y_ofs)</code>. | + | |You can align the object to another with <code style="color: #bb0000;">lv_obj_align(obj, obj_ref, LV_ALIGN_..., x_ofs, y_ofs)</code>. |
− | * <code>obj</code> is the object to align. | + | * <code style="color: #bb0000;">obj</code> is the object to align. |
− | * <code>obj_ref</code> is a reference object. <code>obj</code> will be aligned to it. If <code>obj_ref = NULL</code>, then the parent of <code>obj</code> will be used. | + | * <code style="color: #bb0000;">obj_ref</code> is a reference object. <code style="color: #bb0000;">obj</code> will be aligned to it. If <code style="color: #bb0000;">obj_ref = NULL</code>, then the parent of <code style="color: #bb0000;">obj</code> will be used. |
* The third argument is the ''type'' of alignment. These are the possible options: | * The third argument is the ''type'' of alignment. These are the possible options: | ||
|lv_obj_align(obj, obj_ref, LV_ALIGN_..., x_ofs, y_ofs) を使用して、オブジェクトを別のオブジェクトに位置合わせできます。 | |lv_obj_align(obj, obj_ref, LV_ALIGN_..., x_ofs, y_ofs) を使用して、オブジェクトを別のオブジェクトに位置合わせできます。 | ||
125行目: | 125行目: | ||
|- | |- | ||
| | | | ||
− | * The alignment types build like <code>LV_ALIGN_OUT_TOP_MID</code>. | + | * The alignment types build like <code style="color: #bb0000;">LV_ALIGN_OUT_TOP_MID</code>. |
* The last two arguments allow you to shift the object by a specified number of pixels after aligning it. | * The last two arguments allow you to shift the object by a specified number of pixels after aligning it. | ||
| | | | ||
131行目: | 131行目: | ||
* 最後の 2 つの引数を使用すると、位置合わせ後に、指定したピクセル数だけオブジェクトをシフトできます。 | * 最後の 2 つの引数を使用すると、位置合わせ後に、指定したピクセル数だけオブジェクトをシフトできます。 | ||
|- | |- | ||
− | |For example, to align a text below an image: <code>lv_obj_align(text, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 10)</code>. | + | |For example, to align a text below an image: <code style="color: #bb0000;">lv_obj_align(text, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 10)</code>. |
− | Or to align a text in the middle of its parent: <code>lv_obj_align(text, NULL, LV_ALIGN_CENTER, 0, 0)</code>. | + | Or to align a text in the middle of its parent: <code style="color: #bb0000;">lv_obj_align(text, NULL, LV_ALIGN_CENTER, 0, 0)</code>. |
− | <code>lv_obj_align_origo</code> works similarly to <code>lv_obj_align</code> but it aligns the center of the object. | + | <code style="color: #bb0000;">lv_obj_align_origo</code> works similarly to <code style="color: #bb0000;">lv_obj_align</code> but it aligns the center of the object. |
− | For example, <code>lv_obj_align_origo(btn, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 0)</code> will align the center of the button the bottom of the image. | + | For example, <code style="color: #bb0000;">lv_obj_align_origo(btn, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 0)</code> will align the center of the button the bottom of the image. |
− | The parameters of the alignment will be saved in the object if <code>LV_USE_OBJ_REALIGN</code> is enabled in ''lv_conf.h''. | + | The parameters of the alignment will be saved in the object if <code style="color: #bb0000;">LV_USE_OBJ_REALIGN</code> is enabled in ''lv_conf.h''. |
− | You can then realign the objects simply by calling <code>lv_obj_realign(obj)</code>. | + | You can then realign the objects simply by calling <code style="color: #bb0000;">lv_obj_realign(obj)</code>. |
− | It's equivalent to calling <code>lv_obj_align</code> again with the same parameters. | + | It's equivalent to calling <code style="color: #bb0000;">lv_obj_align</code> again with the same parameters. |
|たとえば、画像の下にテキストを配置するには: lv_obj_align(text, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 10)。 | |たとえば、画像の下にテキストを配置するには: lv_obj_align(text, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 10)。 | ||
または、テキストをその親の中央に配置するには: lv_obj_align(text, NULL, LV_ALIGN_CENTER, 0, 0)。 | または、テキストをその親の中央に配置するには: lv_obj_align(text, NULL, LV_ALIGN_CENTER, 0, 0)。 | ||
162行目: | 162行目: | ||
同じパラメーターで lv_obj_align を再度呼び出すことと同じです。 | 同じパラメーターで lv_obj_align を再度呼び出すことと同じです。 | ||
|- | |- | ||
− | |If the alignment happened with <code>lv_obj_align_origo</code>, then it will be used when the object is realigned. | + | |If the alignment happened with <code style="color: #bb0000;">lv_obj_align_origo</code>, then it will be used when the object is realigned. |
− | The <code>lv_obj_align_x/y</code> and <code>lv_obj_align_origo_x/y</code> function can be used t align only on one axis. | + | The <code style="color: #bb0000;">lv_obj_align_x/y</code> and <code style="color: #bb0000;">lv_obj_align_origo_x/y</code> function can be used t align only on one axis. |
− | If <code>lv_obj_set_auto_realign(obj, true)</code> is used the object will be realigned automatically, if its size changes in <code>lv_obj_set_width/height/size()</code> functions. It's very useful when size animations are applied to the object and the original position needs to be kept. | + | If <code style="color: #bb0000;">lv_obj_set_auto_realign(obj, true)</code> is used the object will be realigned automatically, if its size changes in <code style="color: #bb0000;">lv_obj_set_width/height/size()</code> functions. It's very useful when size animations are applied to the object and the original position needs to be kept. |
194行目: | 194行目: | ||
To get the current parent, use <code style="color: #bb0000;">lv_obj_get_parent(obj)</code>. | To get the current parent, use <code style="color: #bb0000;">lv_obj_get_parent(obj)</code>. | ||
− | To get the children of an object, use <code>lv_obj_get_child(obj, child_prev)</code> (from last to first) or <code>lv_obj_get_child_back(obj, child_prev)</code> (from first to last). To get the first child, pass <code>NULL</code> as the second parameter and use the return value to iterate through the children. The function will return <code>NULL</code> if there are no more children. For example: | + | To get the children of an object, use <code style="color: #bb0000;">lv_obj_get_child(obj, child_prev)</code> (from last to first) or <code style="color: #bb0000;">lv_obj_get_child_back(obj, child_prev)</code> (from first to last). To get the first child, pass <code style="color: #bb0000;">NULL</code> as the second parameter and use the return value to iterate through the children. The function will return <code style="color: #bb0000;">NULL</code> if there are no more children. For example: |
|lv_obj_set_parent(obj, new_parent) を使用して、オブジェクトの新しい親を設定できます。 | |lv_obj_set_parent(obj, new_parent) を使用して、オブジェクトの新しい親を設定できます。 | ||
現在の親を取得するには、lv_obj_get_parent(obj) を使用します。 | 現在の親を取得するには、lv_obj_get_parent(obj) を使用します。 | ||
214行目: | 214行目: | ||
− | <code>lv_obj_count_children_recursive(obj)</code> also tells the number of children but counts children of children recursively. | + | <code style="color: #bb0000;">lv_obj_count_children_recursive(obj)</code> also tells the number of children but counts children of children recursively. |
|lv_obj_get_index(obj) は、オブジェクトの子の数を示します。 | |lv_obj_get_index(obj) は、オブジェクトの子の数を示します。 | ||
これは、親の年少の子供の数に相当します。 | これは、親の年少の子供の数に相当します。 | ||
230行目: | 230行目: | ||
|- | |- | ||
| | | | ||
− | When you have created a screen like <code>lv_obj_t * screen = lv_obj_create(NULL, NULL)</code>, you can load it with <code>lv_scr_load(screen)</code>. The <code>lv_scr_act()</code> function gives you a pointer to the current screen. | + | When you have created a screen like <code style="color: #bb0000;">lv_obj_t * screen = lv_obj_create(NULL, NULL)</code>, you can load it with <code style="color: #bb0000;">lv_scr_load(screen)</code>. The <code style="color: #bb0000;">lv_scr_act()</code> function gives you a pointer to the current screen. |
− | If you have more display then it's important to know that these functions operate on the lastly created or the explicitly selected (with <code>lv_disp_set_default</code>) display. | + | If you have more display then it's important to know that these functions operate on the lastly created or the explicitly selected (with <code style="color: #bb0000;">lv_disp_set_default</code>) display. |
− | To get an object's screen use the <code>lv_obj_get_screen(obj)</code> function. | + | To get an object's screen use the <code style="color: #bb0000;">lv_obj_get_screen(obj)</code> function. |
|lv_obj_t * screen = lv_obj_create(NULL, NULL) のように画面を作成したら、lv_scr_load(screen) で読み込むことができます。 lv_scr_act() 関数は、現在の画面へのポインターを提供します。 | |lv_obj_t * screen = lv_obj_create(NULL, NULL) のように画面を作成したら、lv_scr_load(screen) で読み込むことができます。 lv_scr_act() 関数は、現在の画面へのポインターを提供します。 | ||
265行目: | 265行目: | ||
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. | 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 <code>lv_indev_set_cursor()</code>). | + | But, the ''system layer'' is restricted to system-level things (e.g. mouse cursor will be placed here in <code style="color: #bb0000;">lv_indev_set_cursor()</code>). |
− | The <code>lv_layer_top()</code> and <code>lv_layer_sys()</code> functions gives a pointer to the top or system layer. | + | The <code style="color: #bb0000;">lv_layer_top()</code> and <code style="color: #bb0000;">lv_layer_sys()</code> functions gives a pointer to the top or system layer. |
− | You can bring an object to the foreground or send it to the background with <code>lv_obj_move_foreground(obj)</code> and <code>lv_obj_move_background(obj)</code>. | + | You can bring an object to the foreground or send it to the background with <code style="color: #bb0000;">lv_obj_move_foreground(obj)</code> and <code style="color: #bb0000;">lv_obj_move_background(obj)</code>. |
325行目: | 325行目: | ||
!自動翻訳 | !自動翻訳 | ||
|- | |- | ||
− | |To set an event callback for an object, use <code>lv_obj_set_event_cb(obj, event_cb)</code>, | + | |To set an event callback for an object, use <code style="color: #bb0000;">lv_obj_set_event_cb(obj, event_cb)</code>, |
− | To manually send an event to an object, use <code>lv_event_send(obj, LV_EVENT_..., data)</code> | + | To manually send an event to an object, use <code style="color: #bb0000;">lv_event_send(obj, LV_EVENT_..., data)</code> |
350行目: | 350行目: | ||
− | The name of the parts is constructed like <code>LV_ + <TYPE> _PART_ <NAME></code>. For example <code>LV_BTN_PART_MAIN</code> or <code>LV_SLIDER_PART_KNOB</code>. The parts are usually used when styles are add to the objects. Using parts different styles can be assigned to the different parts of the objects. | + | The name of the parts is constructed like <code style="color: #bb0000;">LV_ + <TYPE> _PART_ <NAME></code>. For example <code style="color: #bb0000;">LV_BTN_PART_MAIN</code> or <code style="color: #bb0000;">LV_SLIDER_PART_KNOB</code>. The parts are usually used when styles are add to the objects. Using parts different styles can be assigned to the different parts of the objects. |
374行目: | 374行目: | ||
− | To add a style to an object use <code>lv_obj_add_style(obj, part, &new_style)</code> function. | + | To add a style to an object use <code style="color: #bb0000;">lv_obj_add_style(obj, part, &new_style)</code> function. |
The Base object use all the rectangle-like style properties. | The Base object use all the rectangle-like style properties. | ||
− | To remove all styles from an object use <code>lv_obj_reset_style_list(obj, part)</code> | + | To remove all styles from an object use <code style="color: #bb0000;">lv_obj_reset_style_list(obj, part)</code> |
− | If you modify a style, which is already used by objects, in order to refresh the affected objects you can use either <code>lv_obj_refresh_style(obj)</code> on each object using it or to notify all objects with a given style use <code>lv_obj_report_style_mod(&style)</code>. | + | If you modify a style, which is already used by objects, in order to refresh the affected objects you can use either <code style="color: #bb0000;">lv_obj_refresh_style(obj)</code> on each object using it or to notify all objects with a given style use <code style="color: #bb0000;">lv_obj_report_style_mod(&style)</code>. |
− | If the parameter of <code>lv_obj_report_style_mod</code> is <code>NULL</code>, all objects will be notified. | + | If the parameter of <code style="color: #bb0000;">lv_obj_report_style_mod</code> is <code style="color: #bb0000;">NULL</code>, all objects will be notified. |
|最初に必ずスタイルの概要をお読みください。 | |最初に必ずスタイルの概要をお読みください。 | ||
406行目: | 406行目: | ||
!自動翻訳 | !自動翻訳 | ||
|- | |- | ||
− | |There are some attributes which can be enabled/disabled by <code>lv_obj_set_...(obj, true/false)</code>: | + | |There are some attributes which can be enabled/disabled by <code style="color: #bb0000;">lv_obj_set_...(obj, true/false)</code>: |
* hidden - Hide the object. It will not be drawn and will be considered by input devices as if it doesn't exist., Its children will be hidden too. | * hidden - Hide the object. It will not be drawn and will be considered by input devices as if it doesn't exist., Its children will be hidden too. | ||
412行目: | 412行目: | ||
* top - If enabled then when this object or any of its children is clicked then this object comes to the foreground. | * top - If enabled then when this object or any of its children is clicked then this object comes to the foreground. | ||
* drag - Enable dragging (moving by an input device) | * drag - Enable dragging (moving by an input device) | ||
− | * drag_dir - Enable dragging only in specific directions. Can be <code>LV_DRAG_DIR_HOR/VER/ALL</code>. | + | * drag_dir - Enable dragging only in specific directions. Can be <code style="color: #bb0000;">LV_DRAG_DIR_HOR/VER/ALL</code>. |
* drag_throw - Enable "throwing" with dragging as if the object would have momentum | * drag_throw - Enable "throwing" with dragging as if the object would have momentum | ||
* drag_parent - If enabled then the object's parent will be moved during dragging. It will look like as if the parent is dragged. Checked recursively, so can propagate to grandparents too. | * drag_parent - If enabled then the object's parent will be moved during dragging. It will look like as if the parent is dragged. Checked recursively, so can propagate to grandparents too. | ||
451行目: | 451行目: | ||
− | The <code>lv_obj_add/clear_protect(obj, LV_PROTECT_...)</code> sets/clears the protection. You can use ''<nowiki/>'OR'ed'' values of protection types too. | + | The <code style="color: #bb0000;">lv_obj_add/clear_protect(obj, LV_PROTECT_...)</code> sets/clears the protection. You can use ''<nowiki/>'OR'ed'' values of protection types too. |
|ライブラリで自動的に発生する特定のアクションがいくつかあります。 | |ライブラリで自動的に発生する特定のアクションがいくつかあります。 | ||
そのようなアクションを 1 つ以上防止するために、オブジェクトをそれらから保護することができます。 | そのようなアクションを 1 つ以上防止するために、オブジェクトをそれらから保護することができます。 | ||
477行目: | 477行目: | ||
|- | |- | ||
| | | | ||
− | Once, an object is added to ''group'' with <code>lv_group_add_obj(group, obj)</code> the object's current group can be get with <code>lv_obj_get_group(obj)</code>. | + | Once, an object is added to ''group'' with <code style="color: #bb0000;">lv_group_add_obj(group, obj)</code> the object's current group can be get with <code style="color: #bb0000;">lv_obj_get_group(obj)</code>. |
− | <code>lv_obj_is_focused(obj)</code> tells if the object is currently focused on its group or not. If the object is not added to a group, <code>false</code> will be returned. | + | <code style="color: #bb0000;">lv_obj_is_focused(obj)</code> tells if the object is currently focused on its group or not. If the object is not added to a group, <code style="color: #bb0000;">false</code> will be returned. |
501行目: | 501行目: | ||
|- | |- | ||
| | | | ||
− | By default, the objects can be clicked only on their coordinates, however, this area can be extended with <code>lv_obj_set_ext_click_area(obj, left, right, top, bottom)</code>. <code>left/right/top/bottom</code> describes how far the clickable area should extend past the default in each direction. | + | By default, the objects can be clicked only on their coordinates, however, this area can be extended with <code style="color: #bb0000;">lv_obj_set_ext_click_area(obj, left, right, top, bottom)</code>. <code style="color: #bb0000;">left/right/top/bottom</code> describes how far the clickable area should extend past the default in each direction. |
− | This feature needs to enabled in ''lv_conf.h'' with <code>LV_USE_EXT_CLICK_AREA</code>. The possible values are: | + | This feature needs to enabled in ''lv_conf.h'' with <code style="color: #bb0000;">LV_USE_EXT_CLICK_AREA</code>. The possible values are: |
− | * LV_EXT_CLICK_AREA_FULL store all 4 coordinates as <code>lv_coord_t</code> | + | * LV_EXT_CLICK_AREA_FULL store all 4 coordinates as <code style="color: #bb0000;">lv_coord_t</code> |
− | * LV_EXT_CLICK_AREA_TINY store only horizontal and vertical coordinates (use the greater value of left/right and top/bottom) as <code>uint8_t</code> | + | * LV_EXT_CLICK_AREA_TINY store only horizontal and vertical coordinates (use the greater value of left/right and top/bottom) as <code style="color: #bb0000;">uint8_t</code> |
* LV_EXT_CLICK_AREA_OFF Disable this feature | * LV_EXT_CLICK_AREA_OFF Disable this feature | ||
|デフォルトでは、オブジェクトは座標上でのみクリックできますが、この領域は lv_obj_set_ext_click_area(obj, left, right, top, bottom) で拡張できます。 left/right/top/bottom は、クリック可能な領域がデフォルトを超えて各方向にどれだけ拡張されるかを示します。 | |デフォルトでは、オブジェクトは座標上でのみクリックできますが、この領域は lv_obj_set_ext_click_area(obj, left, right, top, bottom) で拡張できます。 left/right/top/bottom は、クリック可能な領域がデフォルトを超えて各方向にどれだけ拡張されるかを示します。 |
2022年8月31日 (水) 21:06時点における版
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 の他のすべてのオブジェクトが継承される基本クラスです。 これはコードの重複を減らすのに役立ちます。
|
Coordinates
Size
英文 | 自動翻訳 |
---|---|
The object size can be modified on individual axes with
In a more exact way:
|
オブジェクトのサイズは、lv_obj_set_width(obj, new_width) およびlv_obj_set_height(obj, new_height) を使用して個々の軸上で変更することも、lv_obj_set_size(obj, new_width, new_height) を使用して両方の軸を同時に変更することもできます。
より正確な方法: new_width = left_pad + object_width + right_pad パディングによって削減された幅または高さを取得するには、lv_obj_get_width/height_fit(obj) を使用します。 これは「オブジェクトの有用なサイズ」と見なすことができます。
|
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 to another with lv_obj_align(obj, obj_ref, LV_ALIGN_..., x_ofs, y_ofs) .
|
lv_obj_align(obj, obj_ref, LV_ALIGN_..., x_ofs, y_ofs) を使用して、オブジェクトを別のオブジェクトに位置合わせできます。
|
|
|
For example, to align a text below an image: lv_obj_align(text, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 10) .
Or to align a text in the middle of its parent:
You can then realign the objects simply by calling It's equivalent to calling |
たとえば、画像の下にテキストを配置するには: lv_obj_align(text, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 10)。
または、テキストをその親の中央に配置するには: lv_obj_align(text, NULL, LV_ALIGN_CENTER, 0, 0)。
その後、lv_obj_realign(obj) を呼び出すだけでオブジェクトを再配置できます。 同じパラメーターで lv_obj_align を再度呼び出すことと同じです。 |
If the alignment happened with lv_obj_align_origo , then it will be used when the object is realigned.
|
アライメントが lv_obj_align_origo で発生した場合、オブジェクトが再アライメントされるときに使用されます。
|
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_get_parent(obj) を使用します。
|
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
|
lv_obj_t * screen = lv_obj_create(NULL, NULL) のように画面を作成したら、lv_scr_load(screen) で読み込むことができます。 lv_scr_act() 関数は、現在の画面へのポインターを提供します。
|
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 つの自動生成レイヤーがあります。
最上層に任意のポップアップ ウィンドウを自由に追加できます。 ただし、システム レイヤーはシステム レベルのものに制限されます (たとえば、マウス カーソルは lv_indev_set_cursor() でここに配置されます)。
|
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
|
デフォルトでは、オブジェクトは座標上でのみクリックできますが、この領域は lv_obj_set_ext_click_area(obj, left, right, top, bottom) で拡張できます。 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.
|
オブジェクト タイプによって処理されるキーはありません。
|