[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.
- 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.
The following instructions can be added: Page Change, Set Language, Play Sound, and Custom Instruction.
For instructions on how to use the commands for an event, see Events Instruction Functions.
Note:
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
and END_HMI_EVENT_PROC
.
Description
Determine whether the Button is clicked or not.
Syntax
bool buttonClicked(lv_obj_t* id);
bool buttonClicked(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
Bool. Determine whether the Button is clicked or not.
Example
#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
and END_HMI_EVENT_PROC
.
Description
Determine whether the Button is pressing or not.
Syntax
bool buttonPressing(lv_obj_t* id);
bool buttonPressing(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
Bool. Determine whether the Button is pressing or not.
Example
#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 User Manual for more instructions on 86HMI widgets and API usage.