|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
CRTP mixin that adds fluent layout and visibility setters to widget classes. More...
#include <lvgl.hpp>
Public Member Functions | |
| Derived & | size (int32_t w, int32_t h) |
| Sets both width and height of the object. | |
| Derived & | width (int32_t w) |
| Sets the width of the object. | |
| Derived & | height (int32_t h) |
| Sets the height of the object. | |
| Derived & | pos (int32_t x, int32_t y) |
| Sets the position of the object relative to its parent. | |
| Derived & | center () |
| Centers the object within its parent. | |
| Derived & | align (lv_align_t a, int32_t x_ofs=0, int32_t y_ofs=0) |
| Aligns the object to an anchor with an optional offset. | |
| Derived & | hide () |
Hides the object by adding LV_OBJ_FLAG_HIDDEN. | |
| Derived & | show () |
Shows the object by removing LV_OBJ_FLAG_HIDDEN. | |
| Derived & | visible (bool v) |
| Conditionally shows or hides the object. | |
| Derived & | add_flag (lv_obj_flag_t f) |
| Adds one or more object flags. | |
| Derived & | remove_flag (lv_obj_flag_t f) |
| Removes one or more object flags. | |
| Derived & | add_state (lv_state_t s) |
| Adds one or more object states. | |
| Derived & | remove_state (lv_state_t s) |
| Removes one or more object states. | |
| Derived & | user_data (void *data) |
| Stores an arbitrary user data pointer on the LVGL object. | |
| Derived & | clickable (bool on) |
| Enables or disables click events on the object. | |
CRTP mixin that adds fluent layout and visibility setters to widget classes.
Derive from ObjectMixin<Derived> to gain a chainable API for the most common LVGL object properties (size, position, alignment, flags, state, user data, clickability). All methods return Derived & to support method chaining.
| Derived | The concrete widget class inheriting this mixin. Must expose a get() method returning lv_obj_t*. |
|
inline |
Sets both width and height of the object.
| [in] | w | Width in pixels (or LV_SIZE_CONTENT / LV_PCT(...)). |
| [in] | h | Height in pixels. |
|
inline |
Sets the width of the object.
| [in] | w | Width in pixels. |
|
inline |
Sets the height of the object.
| [in] | h | Height in pixels. |
|
inline |
Sets the position of the object relative to its parent.
| [in] | x | X coordinate in pixels. |
| [in] | y | Y coordinate in pixels. |
|
inline |
Centers the object within its parent.
|
inline |
Aligns the object to an anchor with an optional offset.
| [in] | a | Alignment value (e.g., LV_ALIGN_CENTER). |
| [in] | x_ofs | Horizontal offset in pixels (default: 0). |
| [in] | y_ofs | Vertical offset in pixels (default: 0). |
|
inline |
Hides the object by adding LV_OBJ_FLAG_HIDDEN.
|
inline |
Shows the object by removing LV_OBJ_FLAG_HIDDEN.
|
inline |
Conditionally shows or hides the object.
| [in] | v | true to show, false to hide. |
|
inline |
Adds one or more object flags.
| [in] | f | Flag bitmask (e.g., LV_OBJ_FLAG_CLICKABLE). |
|
inline |
Removes one or more object flags.
| [in] | f | Flag bitmask to clear. |
|
inline |
Adds one or more object states.
| [in] | s | State bitmask (e.g., LV_STATE_CHECKED). |
|
inline |
Removes one or more object states.
| [in] | s | State bitmask to clear. |
|
inline |
Stores an arbitrary user data pointer on the LVGL object.
| [in] | data | Opaque pointer to associate with the object. |
|
inline |
Enables or disables click events on the object.
| [in] | on | true to make the object clickable, false to disable. |