Pervasive Displays Library Suite - Reference Manual 9.0.3
Library for Pervasive Displays e-paper screens, extension boards and development kits
Loading...
Searching...
No Matches
Button Class Reference

Button GUI element. More...

#include <hV_GUI.h>

Inheritance diagram for Button:
Collaboration diagram for Button:

Public Member Functions

 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.
 
- Public Member Functions inherited from Area
 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.
 

Friends

class CheckBox
 

Detailed Description

Button GUI element.

Button is an area with a label

Constructor & Destructor Documentation

◆ Button()

Button::Button ( GUI * gui)

Constructor.

Parameters
gui&gui to which the element belongs

Member Function Documentation

◆ check()

bool Button::check ( uint8_t mode = 0)

Check button is pressed.

With button animation

Parameters
modedefault = 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
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
item0item (including index and text)
size0size for text, default = fontSizeAutomatic = automatic


More: Coordinates, Colours

◆ draw()

void Button::draw ( fsmGUI_e fsm = fsmReleased)

Draw the button.

Parameters
fsmstate
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
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
text0text
size0size 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
valuevalue true = default, false
Note
Only if setOption = optionFlipFlop for flip-flop button

The documentation for this class was generated from the following file: