我想找...

搜尋

分享

目錄

86HMI::Roller

[Menu widgets]

Object Functions

Roller object.

Roller-1

Roller Properties.

Roller-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:

  • Roller Mode: Set item list display mode.
    1. 標準
    2. 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()

描述

Get Roller state.

語法

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

參數

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

Return

Roller state.

範例

#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 以及 END_HMI_EVENT_PROC.

描述

Determine Roller’s Item is selected.

語法

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

參數

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

Return

Bool. Determine Roller’s Item is selected.

範例

#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 編輯器使用手冊 for more instructions on 86HMI widgets and API usage.

返回頂端