I want to find...

Search

Shares

Table of Content

86HMI::DropDownList

[Menu widgets]

Object Functions

DropDownList object.

DropDownList-1

DropDownList Properties.

DropDownList-2

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:

  • 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

getDropDownListSelectedItem()

Description

Get DropDownList state.

Syntax

int32_t getDropDownListSelectedItem(lv_obj_t* id);
int32_t getDropDownListSelectedItem(char* name);

Parameters

  • [in] id
    Object ID.
  • [in] name
    Object Name.

Return

DropDownList state.

Example

#include "myhmi.h"

void setup() {
  Serial.begin(115200);
  while (!Serial);
  
  Hmi.begin();
  // ...
  Serial.println(Hmi.getDropDownListSelectedItem(p1ddl1));
}

void loop() {
  // ...
}

dropDownListItemSelected()

The following Event Functions are written between BEGIN_HMI_EVENT_PROC and END_HMI_EVENT_PROC.

Description

Determine DropDownList Item is selected.

Syntax

bool dropDownListItemSelected(lv_obj_t* id);
bool dropDownListItemSelected(char* name);

Parameters

  • [in] id
    Object ID.
  • [in] name
    Object Name.

Return

Bool. Determine DropDownList Item is selected.

Example

#include "myhmi.h"

void setup() {
  Serial.begin(115200);
  while (!Serial);
  
  Hmi.begin();
}

void loop() {
  // ...
  BEGIN_HMI_EVENT_PROC
  {
    if Hmi.dropDownListItemSelected(p1ddl1))
    {
      Serial.println(Hmi.getDropDownListSelectedItem(p1ddl1));
    }
  }
  END_HMI_EVENT_PROC
}

Please see the 86HMI Editor User Manual for more instructions on 86HMI widgets and API usage.

Scroll to Top