Table GUI element.
More...
#include <hV_GUI.h>
|
| Table (GUI *gui) |
| Constructor.
|
|
void | dDefine (uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, uint8_t columns=4, uint8_t lines=3) |
| Define the table, vector coordinates.
|
|
void | define (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t columns=4, uint8_t lines=3) |
| Define the table, rectangle coordinates.
|
|
void | drawInitial () |
| Draw the initial empty table.
|
|
void | draw (uint8_t indexColumn, uint8_t indexLine, uint16_t colour=myColours.black, uint8_t pattern=0x11) |
| Update the table.
|
|
void | setState (bool state=true) |
| Define state of the table.
|
|
bool | check (uint8_t mode=0) |
| Check if table is pressed.
|
|
void | getIndex (uint8_t &indexColumn, uint8_t &indexLine) |
| Return column and row indexes of the cell touched.
|
|
| 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.
|
|
Table GUI element.
Table displays columns and rows of cells.
◆ Table()
Table::Table |
( |
GUI * | gui | ) |
|
Constructor.
- Parameters
-
gui | &gui to which the element belongs |
◆ check()
bool Table::check |
( |
uint8_t | mode = 0 | ) |
|
Check if table is pressed.
- Parameters
-
mode | default = checkNormal = area waits for release, checkInstant = element is activated by press only |
- Returns
- true if button pressed
◆ dDefine()
void Table::dDefine |
( |
uint16_t | x0, |
|
|
uint16_t | y0, |
|
|
uint16_t | dx, |
|
|
uint16_t | dy, |
|
|
uint8_t | columns = 4, |
|
|
uint8_t | lines = 3 ) |
Define the table, vector coordinates.
- Parameters
-
x0 | point coordinate, x-axis |
y0 | point coordinate, y-axis |
dx | length, x-axis |
dy | height, y-axis |
columns | number of columns, default = 4 |
lines | number of rows, default = 3 |
- Note
- The touch on table is disabled at initialisation.
More: Coordinates, Colours
◆ define()
void Table::define |
( |
uint16_t | x1, |
|
|
uint16_t | y1, |
|
|
uint16_t | x2, |
|
|
uint16_t | y2, |
|
|
uint8_t | columns = 4, |
|
|
uint8_t | lines = 3 ) |
Define the table, rectangle coordinates.
- Parameters
-
x1 | top left coordinate, x-axis |
y1 | top left coordinate, y-axis |
x2 | bottom right coordinate, x-axis |
y2 | bottom right coordinate, y-axis |
columns | number of columns, default = 4 |
lines | number of rows, default = 3 |
- Note
- The touch on table is disabled at initialisation.
More: Coordinates, Colours
◆ draw()
void Table::draw |
( |
uint8_t | indexColumn, |
|
|
uint8_t | indexLine, |
|
|
uint16_t | colour = myColours.black, |
|
|
uint8_t | pattern = 0x11 ) |
Update the table.
- Parameters
-
indexColumn | cell to update, column number = 0..columns - 1 |
indexLine | cell to update, row number = 0..lines - 1 |
colour | colour for the cell default = myColours.black |
pattern | on the cell, default = patternSquare |
◆ getIndex()
void Table::getIndex |
( |
uint8_t & | indexColumn, |
|
|
uint8_t & | indexLine ) |
Return column and row indexes of the cell touched.
- Parameters
-
indexColumn | cell touched, column index = 0..columns - 1 |
indexLine | cell touched, row index = 0..lines - 1 |
uint8_t indexColumn, indexLine;
if myTable.check()
{
myTable.getIndex(&indexColumn, &indexLine);
}
◆ setState()
void Table::setState |
( |
bool | state = true | ) |
|
Define state of the table.
- Parameters
-
state | default = stateEnabled = table enabled, stateDisabled = otherwise |
- Note
- When created, state set to false
The documentation for this class was generated from the following file: