Pervasive Displays Library Suite - Reference Manual 9.0.3
Library for Pervasive Displays e-paper screens, extension boards and development kits
|
Radio-buttons GUI element. More...
#include <hV_GUI.h>
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. | |
Radio-buttons GUI element.
RadioButtons contains 2 or 3 mutually exclusive options.
RadioButtons::RadioButtons | ( | GUI * | gui | ) |
Constructor.
gui | &gui to which the element belongs |
bool RadioButtons::check | ( | uint8_t | mode = 0 | ) |
Check radio-button is pressed.
With button animation
mode | default = checkNormal = area waits for release, checkInstant = element is activated by press only |
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.
x0 | point coordinate, x-axis |
y0 | point coordinate, y-axis |
dx | length, x-axis |
dy | height, y-axis |
item1 | item for first button |
item2 | item for second button |
item3 | item for third button, optional |
size | size of the font, default = fontSizeAutomatic = automatic, optional |
void RadioButtons::draw | ( | fsmGUI_e | fsm = fsmReleased | ) |
Draw the radio-buttons.
With button animation
fsm | state |
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.
x0 | point coordinate, x-axis |
y0 | point coordinate, y-axis |
dx | length, x-axis |
dy | height, y-axis |
button1 | text for first button |
button2 | text for second button |
button3 | text for third button, optional |
size | size of the font, default = fontSizeAutomatic = automatic, optional |
uint16_t RadioButtons::getIndex | ( | ) |
Return index of the selected radio-button.
uint8_t RadioButtons::getValue | ( | ) |
Return selected radio-button.
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.
option | default = optionVertical = vertical, optionHorizontal = horizontal |
void RadioButtons::setValue | ( | uint8_t | value = 0 | ) |
Set selected radio-button.
value | selected radio-button, default = 0 = none |