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

Radio-buttons GUI element. More...

#include <hV_GUI.h>

Inheritance diagram for RadioButtons:
Collaboration diagram for RadioButtons:

Public Member Functions

 RadioButtons (GUI *gui)
 Constructor.
 
void dDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, Item item1, Item item2, Item item3=itemEmpty, uint8_t size=0xff)
 Define radio buttons, vector coordinates.
 
void dStringDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, STRING_CONST_TYPE button1, STRING_CONST_TYPE button2, STRING_CONST_TYPE button3="\0", uint8_t size=0xff)
 Define radio buttons, vector coordinates.
 
void setOption (bool option=true)
 Set orientation of the radio-buttons.
 
void draw (fsmGUI_e fsm=fsmReleased)
 Draw the radio-buttons.
 
bool check (uint8_t mode=0)
 Check radio-button is pressed.
 
void setValue (uint8_t value=0)
 Set selected radio-button.
 
uint8_t getValue ()
 Return selected radio-button.
 
uint16_t getIndex ()
 Return index of the selected radio-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.
 

Detailed Description

Radio-buttons GUI element.

RadioButtons contains 2 or 3 mutually exclusive options.

Constructor & Destructor Documentation

◆ RadioButtons()

RadioButtons::RadioButtons ( GUI * gui)

Constructor.

Parameters
gui&gui to which the element belongs

Member Function Documentation

◆ check()

bool RadioButtons::check ( uint8_t mode = 0)

Check radio-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 RadioButtons::dDefine ( uint16_t x0,
uint16_t y0,
uint16_t dx,
uint16_t dy,
Item item1,
Item item2,
Item item3 = itemEmpty,
uint8_t size = 0xff )

Define radio buttons, vector coordinates.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
item1item for first button
item2item for second button
item3item for third button, optional
sizesize of the font, default = fontSizeAutomatic = automatic, optional
Note
button1 and button2 are compulsory, button3 optional.
Buttons are displayed from top to down or from left to right.

◆ draw()

void RadioButtons::draw ( fsmGUI_e fsm = fsmReleased)

Draw the radio-buttons.

With button animation

Parameters
fsmstate
Note
4 states
* if button enabled,
fsm = fsmReleased, fsmTouched, fsmConfirmed
* if button disabled,
flag = true: statement checkbox, flag = false: unavailable checkbox
If value = 0, display all

◆ dStringDefine()

void RadioButtons::dStringDefine ( uint16_t x0,
uint16_t y0,
uint16_t dx,
uint16_t dy,
STRING_CONST_TYPE button1,
STRING_CONST_TYPE button2,
STRING_CONST_TYPE button3 = "\0",
uint8_t size = 0xff )

Define radio buttons, vector coordinates.

Parameters
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
button1text for first button
button2text for second button
button3text for third button, optional
sizesize of the font, default = fontSizeAutomatic = automatic, optional
Note
button1 and button2 are compulsory, button3 optional.
Buttons are displayed from top to down or from left to right.

◆ getIndex()

uint16_t RadioButtons::getIndex ( )

Return index of the selected radio-button.

Returns
index from items defined with dDefine, 0 = none

◆ getValue()

uint8_t RadioButtons::getValue ( )

Return selected radio-button.

Returns
current value 1, 2, 3, from top to down or from left to right, 0 = none

◆ setOption()

void RadioButtons::setOption ( bool option = true)

Set orientation of the radio-buttons.

The radio-buttons are initialised with true = vertical. Use setOption to change the orientation.

Parameters
optiondefault = optionVertical = vertical, optionHorizontal = horizontal

◆ setValue()

void RadioButtons::setValue ( uint8_t value = 0)

Set selected radio-button.

Parameters
valueselected radio-button, default = 0 = none

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