lvgl.numberEdit
lvgl.numberEdit([parent, ]params)
Add a number edit box using the EdgeTX style.
Parameters
| Name | Req | Type | Description |
|---|
parent | no | object | optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window |
params | yes | table | |
| Field | Type | Description |
|---|
x | number | position relative to the top-left of the parent | y | number | position relative to the top-left of the parent | w | number | width | h | number | height | color | color or function | primary color for the object | pos | function | dynamic position callback returning x, y | size | function | dynamic size callback returning w, h | visible | function | dynamic visibility callback | floating | boolean | keep the object fixed inside a scrollable container, added in 2.11.6, defaults to false | get | function | called to get the current value to display, defaults to nil | set | function | called for every change to the number while editing; passed the new value, defaults to nil | edited | function | called after the user finishes editing; passed the final value (added in 2.11.5), defaults to nil | active | function | sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil | min | number | minimum allowed value, defaults to -1024 | max | number | maximum allowed value, defaults to 1024 | display | function | overrides how the value is displayed; passed the current value, must return a string, defaults to nil |
|
Returns
| Name | Type | Description |
- | table | LVGL object, or nil if not running as a One-Time script or fullscreen widget |
Availability
- Since:
2.11.0 - Radio support:
color-lcd
Notes
- Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise. @notice Use
set to react to every change during editing, or edited to only react to the final value once editing is complete.
Source
radio/src/lua/api_colorlcd_lvgl.cpp