Skip to content

Constants

NameDescription
lvgl.FLOW_ROWSets flex layout flow.
lvgl.FLOW_COLUMNSet flex layout flow.
lvgl.PAD_TINY2 pixel padding.
lvgl.PAD_SMALL4 pixel padding.
lvgl.PAD_MEDIUM6 pixel padding.
lvgl.PAD_LARGE8 pixel padding.
lvgl.PAD_OUTLINEPadding required around controls for focus outline.
lvgl.PAD_BORDERPadding size of the default border around controls.

Constants for the 'filter' property of the lvgl.source control. Can be used to limit which sources the user can select.

NameDescription
lvgl.SRC_ALLAllow all source types, enable the 'Clear' button and the 'Invert' button.
lvgl.SRC_INPUTInputs
lvgl.SRC_STICKAnalog sticks
lvgl.SRC_POTPots and sliders
lvgl.SRC_SWITCHSwitches
lvgl.SRC_CHANNELOutputs
lvgl.SRC_TRIMTrims
lvgl.SRC_LOGICAL_SWITCHLogical switches
lvgl.SRC_GVARGlobal variables
lvgl.SRC_LUACustom Lua mix script outputs
lvgl.SRC_OTHERMIN, MAX, tx battery, timers etc.
lvgl.SRC_HELIHeli channels
lvgl.SRC_TRAINERTrainer channels
lvgl.SRC_TELEMTelemetry sensors
lvgl.SRC_CLEARSpecial value to control the 'Clear' button in the source chooser.
lvgl.SRC_INVERTSpecial value to control the 'Invert' button in the source chooser.

Constants for the 'filter' property of the lvgl.witch control. Can be used to limit which sources the user can select.

NameDescription
lvgl.SW_ALLAllow all switch types, enable the 'Clear' button.
lvgl.SW_SWITCHSwitches
lvgl.SW_TRIMTrims
lvgl.SW_LOGICAL_SWITCHLogical switches
lvgl.SW_FLIGHT_MODEFlight modes
lvgl.SW_TELEMTelemetry sensors
lvgl.SW_OTHERON, ONE, trainer connected, radio activity, etc
lvgl.SW_CLEARSpecial value to control the 'Clear' button in the switch chooser.

Constants to control scrolling of containers such as box and rectangle

NameDescription
lvgl.SCROLL_OFFNo scrolling allowed. Objects outside the containers boundary will be clipped
lvgl.SCROLL_HORHorizontal scrolling only
lvgl.SCROLL_VERVertical scrolling only
lvgl.SCROLL_ALLBoth horizontal and vertical scrolling allowed

Constants for managing page layout (see the API section for more details). Added in 2.11.4.

NameDescription
lvgl.PAGE_BODY_HEIGHTHeight of the body section for a 'page' object.
lvgl.UI_ELEMENT_HEIGHTDefault height for controls (buttons, toggle, etc)
lvgl.LCD_SCALEScale factor for the LCD display compared to the standard 480x272 size display.

Standard displays with LCD sizes 480x272, 480x320 and 320x480 have a scaling factor of 1.0.

Radios with a 320x240 LCD have a scaling factor of 0.8.

Radios with a 800x480 LCD have a scaling factor of 1.375.
lvgl.PERCENT_SIZEUsed to create percentage based position and size values for objects., based on the size of the parent container.

To use a percentage size set the desired property to lvgl.PERCENT_SIZE + N, where N is the percentage value from 1 to 100. E.G. w=lvgl.PERCENT_SIZE + 50.

Object creation constants (when using the 'build' function). Added in 2.11.4.

As an alternative to sepcifying the type for an object by name the following contants may be used.

NameEquivalent to:
lvgl.LABEL"label"
lvgl.RECTANGLE"rectangle"
lvgl.CIRCLE"circle"
lvgl.ARC"arc"
lvgl.HLINE"hline"
lvgl.VLINE"vline"
lvgl.LINE"line"
lvgl.TRIANGLE"triangle"
lvgl.IMAGE"image"
lvgl.QRCODE"qrcode"
lvgl.BOX"box"
lvgl.BUTTON"button"
lvgl.MOMENTARY_BUTTON"momentaryButton"
lvgl.TOGGLE"toggle"
lvgl.TEXT_EDIT"textEdit"
lvgl.NUMBER_EDIT"numbeEdit"
lvgl.CHOICE"choice"
lvgl.SLIDER"slider"
lvgl.VERTICAL_SLIDER"verticalSlider"
lvgl.PAGE"page"
lvgl.FONT"font"
lvgl.ALIGN"align"
lvgl.COLOR"color"
lvgl.TIMER"timer"
lvgl.SWITCH"switch"
lvgl.SOURCE"source"
lvgl.FILE"file"
lvgl.SETTING"setting"