Button GUI element.
More...
#include <hV_GUI.h>
|
| Button (GUI *gui) |
| Constructor.
|
|
void | dDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, Item item0, uint8_t size0=0xff) |
| Define item-based button, vector coordinates.
|
|
void | dStringDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, STRING_CONST_TYPE text0, uint8_t size0=0xff) |
| Define item-based button, vector coordinates.
|
|
void | draw (fsmGUI_e fsm=fsmReleased) |
| Draw the button.
|
|
bool | check (uint8_t mode=0) |
| Check button is pressed.
|
|
void | setValue (bool value=true) |
| Set current value of the flip-flop button.
|
|
bool | getValue () |
| Return current value of the flip-flop button.
|
|
| Area (GUI *gui) |
| Constructor.
|
|
void | dDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, uint16_t index=0x0000) |
| Define area, vector coordinates.
|
|
bool | getState () |
| Return state of the area.
|
|
void | setState (bool state=true) |
| Define state of the area.
|
|
void | setOption (bool option=true) |
| Set option of the area.
|
|
void | setStyle (uint8_t style=0) |
| Define the default style.
|
|
bool | check (uint8_t mode=0) |
| Check if area is pressed.
|
|
uint16_t | getIndex () |
| Return index.
|
|
Button GUI element.
Button is an area with a label
◆ Button()
Button::Button |
( |
GUI * | gui | ) |
|
Constructor.
- Parameters
-
gui | &gui to which the element belongs |
◆ check()
bool Button::check |
( |
uint8_t | mode = 0 | ) |
|
Check button is pressed.
With button animation
- Parameters
-
mode | default = checkNormal = area waits for release, checkInstant = element is activated by press only |
- Returns
- true if button pressed
◆ dDefine()
void Button::dDefine |
( |
uint16_t | x0, |
|
|
uint16_t | y0, |
|
|
uint16_t | dx, |
|
|
uint16_t | dy, |
|
|
Item | item0, |
|
|
uint8_t | size0 = 0xff ) |
Define item-based button, vector coordinates.
- Parameters
-
x0 | point coordinate, x-axis |
y0 | point coordinate, y-axis |
dx | length, x-axis |
dy | height, y-axis |
item0 | item (including index and text) |
size0 | size for text, default = fontSizeAutomatic = automatic |
More: Coordinates, Colours
◆ draw()
Draw the button.
- Parameters
-
- Note
- 4 states
* if button enabled,
fsm = fsmReleased, fsmTouched, fsmConfirmed
* if button disabled,
flag = true: statement checkbox, flag = false: unavailable checkbox
◆ dStringDefine()
void Button::dStringDefine |
( |
uint16_t | x0, |
|
|
uint16_t | y0, |
|
|
uint16_t | dx, |
|
|
uint16_t | dy, |
|
|
STRING_CONST_TYPE | text0, |
|
|
uint8_t | size0 = 0xff ) |
Define item-based button, vector coordinates.
- Parameters
-
screen | &screen to which the button belongs |
x0 | point coordinate, x-axis |
y0 | point coordinate, y-axis |
dx | length, x-axis |
dy | height, y-axis |
text0 | text |
size0 | size for text, default = fontSizeAutomatic = automatic |
More: Coordinates, Colours
◆ getValue()
bool Button::getValue |
( |
| ) |
|
Return current value of the flip-flop button.
- Returns
- current value true = checked or false = unchecked
- Note
- Only if setOption = optionFlipFlop for flip-flop button
◆ setValue()
void Button::setValue |
( |
bool | value = true | ) |
|
Set current value of the flip-flop button.
- Parameters
-
value | value true = default, false |
- Note
- Only if setOption = optionFlipFlop for flip-flop button
The documentation for this class was generated from the following file: