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

Table GUI element. More...

#include <hV_GUI.h>

Inheritance diagram for Table:
Collaboration diagram for Table:

Public Member Functions

 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.
 
- 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

Table GUI element.

Table displays columns and rows of cells.

Constructor & Destructor Documentation

◆ Table()

Table::Table ( GUI * gui)

Constructor.

Parameters
gui&gui to which the element belongs

Member Function Documentation

◆ check()

bool Table::check ( uint8_t mode = 0)

Check if table is pressed.

Parameters
modedefault = 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
x0point coordinate, x-axis
y0point coordinate, y-axis
dxlength, x-axis
dyheight, y-axis
columnsnumber of columns, default = 4
linesnumber 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
x1top left coordinate, x-axis
y1top left coordinate, y-axis
x2bottom right coordinate, x-axis
y2bottom right coordinate, y-axis
columnsnumber of columns, default = 4
linesnumber 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
indexColumncell to update, column number = 0..columns - 1
indexLinecell to update, row number = 0..lines - 1
colourcolour for the cell default = myColours.black
patternon the cell, default = patternSquare

◆ getIndex()

void Table::getIndex ( uint8_t & indexColumn,
uint8_t & indexLine )

Return column and row indexes of the cell touched.

Parameters
indexColumncell touched, column index = 0..columns - 1
indexLinecell 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
statedefault = stateEnabled = table enabled, stateDisabled = otherwise
Note
When created, state set to false

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