[Menu widgets]
Object Functions
List object.

List 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.
Item Settings:
- Number of Items: Number of items, from 2 to 16, default is 5.
- Item1~n Text: Each item name.
- Item1~n PrefixSymbol: Each item prefix symbol.
Options:
- Spacing: Item space.
- 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
getListSelectedItem()
Description
Get List selected item number.
Syntax
int getListSelectedItem(lv_obj_t* id);
int getListSelectedItem(char *name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
List the selected item number.
Example
#include "myhmi.h"
void setup() {
Serial.begin(115200);
while (!Serial);
Hmi.begin();
Serial.println(Hmi.getListSelectedItem(p1li1));
}
void loop() {
// ...
}listItemSelected()
The following Event Functions are written between BEGIN_HMI_EVENT_PROC and END_HMI_EVENT_PROC.
Description
Determine List’s Item is selected.
Syntax
bool listItemSelected(lv_obj_t* id);
bool listItemSelected(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
Bool. Determine List’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.listItemSelected(p1li1))
{
Serial.println(Hmi.getListSelectedItem(p1li1));
}
}
END_HMI_EVENT_PROC
}Please see the 86HMI Editor User Manual for more instructions on 86HMI widgets and API usage.