[Menu widgets]
Object Functions
Roller object.

Roller Properties.

Identifier:
- ID: Unique number that identifies the object.
- Name: User-definable name for the object. It can be used with 86HMI API.
Geometry:
- X: Object X coordinate.
- Y: Object Y coordinate.
- Width: Object width.
- Height: Object height.
Options:
- Roller Mode: Set item list display mode.
- Normal
- Infinite
- ItemList: The item list setting allows you to define the text content of the options and add new options. Pull down the text input box in the menu and the options will be filled in one by one according to the line feed.
- TextFont: Choose from 6 default font styles. For font configuration instructions, please refer to Theme Management.
- ObjColor: Choose from 4 themed colors. For font configuration instructions, please refer to Theme Management.
- Enable: Select the default state of the object, enable or disable.
- Order: Object order. It can adjust the object order by up/down, which can be viewed on the Object List.
API Functions
getRollerSelectedItem()
Description
Get Roller state.
Syntax
int32_t getRollerSelectedItem(lv_obj_t* id);
int32_t getRollerSelectedItem(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
Roller state.
Example
#include "myhmi.h" void setup() { Serial.begin(115200); while (!Serial); Hmi.begin(); Serial.println(Hmi.getRollerSelectedItem(p1ro1)); } void loop() { // ... }
rollerItemSelected()
The following Event Functions are written between BEGIN_HMI_EVENT_PROC
and END_HMI_EVENT_PROC
.
Description
Determine Roller’s Item is selected.
Syntax
bool rollerItemSelected(lv_obj_t* id);
bool rollerItemSelected(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
Bool. Determine Roller’s Item is selected.
Example
#include "myhmi.h" void setup() { Serial.begin(115200); while (!Serial); Hmi.begin(); // ... } void loop() { // ... BEGIN_HMI_EVENT_PROC { if (Hmi.rollerItemSelected(p1ro1)) { Serial.println(Hmi.getRollerSelectedItem(p1ro1)); } } END_HMI_EVENT_PROC }
Please see the 86HMI Editor User Manual for more instructions on 86HMI widgets and API usage.