[Control widgets]
Object Functions
Button object.

Button Properties.

Identifier:
- ID: Unique number that identifies the object.
- Name: User-definable name for the object. It can be used with 86HMI API.
Content:
- PrefixSymbol: Select the built-in button icon as an embellishment icon and scroll the mouse to drop down the options.
- Text: Butten content text.
Geometry:
- X: Object X coordinate.
- Y: Object Y coordinate.
- Width: Object width.
- Height: Object height.
Options:
- Type: Button style.
- Appearance A: Only the border of the object is colored.

- Appearance B: Fill in the object color without the border.

- Invisible: Object without any color.

- Appearance A: Only the border of the object is colored.
- TextColor: Text color can be chosen through the color palette or by directly inputting the color code.
- 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.
Button Events.

Button object event conditions: Clicked, Pressing.

目前支持的指令包括切換頁面 (Page Change)、設定語言 (Set Language)、播放音效 (Play Sound)、Custom Instruction。
For instructions on how to use the commands for an event, see Events Instruction Functions.

注意:
Custom Instruction allows the user to edit the events to be executed by the object or page using the editing code. This option is a professional advanced option, and the user should be familiar with the 86Duino program before editing.
API Functions
buttonClicked()
The following Event Functions are written between BEGIN_HMI_EVENT_PROC 以及 END_HMI_EVENT_PROC.
描述
Determine whether the Button is clicked or not.
語法
bool buttonClicked(lv_obj_t* id);
bool buttonClicked(char* name);
參數
[in] id
Object ID.[in] name
Object Name.
Return
Bool. Determine whether the Button is clicked or not.
範例
#include "myhmi.h"
void setup() {
Hmi.begin();
}
void loop() {
BEGIN_HMI_EVENT_PROC
{
if (Hmi.buttonClicked(p1b1))
{
// do something...
}
}
END_HMI_EVENT_PROC
}buttonPressing()
The following Event Functions are written between BEGIN_HMI_EVENT_PROC 以及 END_HMI_EVENT_PROC.
描述
Determine whether the Button is pressing or not.
語法
bool buttonPressing(lv_obj_t* id);
bool buttonPressing(char* name);
參數
[in] id
Object ID.[in] name
Object Name.
Return
Bool. Determine whether the Button is pressing or not.
範例
#include "myhmi.h"
void setup() {
Hmi.begin();
}
void loop() {
BEGIN_HMI_EVENT_PROC
{
if (Hmi.buttonPressing(p1b1))
{
// do something...
}
}
END_HMI_EVENT_PROC
}Please see the 86HMI Editor使用手冊 for more instructions on 86HMI widgets and API usage.