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
Switch Class Reference

Switch GUI element. More...

#include <hV_GUI.h>

Inheritance diagram for Switch:
Collaboration diagram for Switch:

Public Member Functions

 Switch (GUI *gui)
 Constructor.
 
void dDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, Item itemLeftBottom, Item itemRightTop, uint8_t size0=0xff)
 Define item-based switch, vector coordinates.
 
void dStringDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, STRING_CONST_TYPE textLeftBottom, STRING_CONST_TYPE textRightTop, uint8_t size=0xff)
 Define switch, vector coordinates.
 
void draw (fsmGUI_e fsm=fsmReleased)
 Draw the switch.
 
bool check (uint8_t mode=0)
 Check switch is pressed.
 
int8_t getValue ()
 Return current value.
 
uint16_t getIndex ()
 Return index of the switch.
 
- 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.
 

Detailed Description

Switch GUI element.

Switch is a two-state button

Constructor & Destructor Documentation

◆ Switch()

Switch::Switch ( GUI * gui)

Constructor.

Parameters
gui&gui to which the element belongs

Member Function Documentation

◆ check()

bool Switch::check ( uint8_t mode = 0)

Check switch is pressed.

With switch animation

Parameters
modedefault = checkNormal = area waits for release, checkInstant = element is activated by press only
Returns
true if switch pressed

◆ dDefine()

void Switch::dDefine ( uint16_t x0,
uint16_t y0,
uint16_t dx,
uint16_t dy,
Item itemLeftBottom,
Item itemRightTop,
uint8_t size0 = 0xff )

Define item-based switch, vector coordinates.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
itemLeftBottomleft or bottom item (including index and text)
itemRightTopright or top item (including index and text)
size0size for text, default = fontSizeAutomatic = automatic


More: Coordinates, Colours

◆ draw()

void Switch::draw ( fsmGUI_e fsm = fsmReleased)

Draw the switch.

Parameters
fsmstate
Note
4 states
* if switch enabled,
fsm = fsmReleased, fsmTouched, fsmConfirmed
* if switch disabled,
flag = true: statement switch, flag = false: unavailable switch

◆ dStringDefine()

void Switch::dStringDefine ( uint16_t x0,
uint16_t y0,
uint16_t dx,
uint16_t dy,
STRING_CONST_TYPE textLeftBottom,
STRING_CONST_TYPE textRightTop,
uint8_t size = 0xff )

Define switch, vector coordinates.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
textLeftBottomtext for left or bottom
textRightToptext for right or top
sizesize of the font, default = fontSizeAutomatic = automatic, optional

◆ getIndex()

uint16_t Switch::getIndex ( )

Return index of the switch.

Returns
index from items defined with dDefine

◆ getValue()

int8_t Switch::getValue ( )

Return current value.

Returns
current position, horizontalLeft = verticalBottom = -1 or horizontalRight = verticalTop = +1

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