Class evab::Grid¶
Layout manager for rest-based UI arrangement. More...
#include <evabGrid.h>
Public Functions¶
| Type | Name |
|---|---|
| void | Clear (unsigned char aIsFocused=0) Clears the current cell area. |
| Grid | CutCol (unsigned char aWidth=0) Creates a new Grid for the next column. |
| Grid | CutRow (unsigned char aHeight=0) Creates a new Grid for the next row. |
| void | Draw (ElementBase & aElement, unsigned char aIsFocused=0) Draws an element in the current cell. |
| Coor | GetPos () const Gets the current position. |
| Coor | GetSize () const Gets the current size. |
| Grid (Screen * aScreen, Coor aPos, Coor aSize, unsigned char aIsFocused) Constructs a Grid for a specific area. |
|
| void | Picto (const unsigned char * aPictogram, unsigned char aIsFocused=0) Draws a pictogram in the current cell. |
| void | Text (TText aText, unsigned char aIsFocused=0) Draws text with specified alignment. |
| void | TextCenter (T aText, unsigned char aIsFocused=0) Draws center-aligned text. |
| void | TextLeft (T aText, unsigned char aIsFocused=0) Draws left-aligned text. |
| void | TextRight (T aText, unsigned char aIsFocused=0) Draws right-aligned text. |
Detailed Description¶
Grid provides a fluent interface for organizing UI elements in a rest. Each CutRow()/CutCol() returns a new Grid representing the cell.
Grid rest({0,0}, {16,8});
rest.CutRow(2).Draw(element1);
rest.CutRow(2).CutCol(2).Draw(element2);
rest.CutRow(2).CutCol(2).Clear();
rest.Clear();
Public Functions Documentation¶
function Clear¶
Clears the current cell area.
void evab::Grid::Clear (
unsigned char aIsFocused=0
)
function CutCol¶
Creates a new Grid for the next column.
Grid evab::Grid::CutCol (
unsigned char aWidth=0
)
Parameters:
aWidthWidth of the column (0 = use remaining width)
Returns:
Grid New rest representing the column
function CutRow¶
Creates a new Grid for the next row.
Grid evab::Grid::CutRow (
unsigned char aHeight=0
)
Parameters:
aHeightHeight of the row (0 = use remaining height)
Returns:
Grid New rest representing the row
function Draw¶
Draws an element in the current cell.
void evab::Grid::Draw (
ElementBase & aElement,
unsigned char aIsFocused=0
)
Parameters:
aElementElement to drawaIsFocusedFocus state (1 = focused, 0 = not focused)
function GetPos¶
Gets the current position.
inline Coor evab::Grid::GetPos () const
Returns:
Coor Current position
function GetSize¶
Gets the current size.
Coor evab::Grid::GetSize () const
Returns:
Coor Current size (clamped to non-negative values)
function Grid¶
Constructs a Grid for a specific area.
evab::Grid::Grid (
Screen * aScreen,
Coor aPos,
Coor aSize,
unsigned char aIsFocused
)
Parameters:
aScreenScreen to draw onaPosPosition on screenaSizeSize of the rest area
function Picto¶
Draws a pictogram in the current cell.
void evab::Grid::Picto (
const unsigned char * aPictogram,
unsigned char aIsFocused=0
)
Parameters:
aPictogramPictogram dataaIsFocusedColor/inversion flag
function Text¶
Draws text with specified alignment.
template<typename TAlign, typename TText>
inline void evab::Grid::Text (
TText aText,
unsigned char aIsFocused=0
)
Template parameters:
TAlignAlignment strategy (LeftAlign, CenterAlign, RightAlign)TTextText type
Parameters:
aTextText to drawaIsFocusedColor/inversion flag
function TextCenter¶
Draws center-aligned text.
template<typename T>
inline void evab::Grid::TextCenter (
T aText,
unsigned char aIsFocused=0
)
function TextLeft¶
Draws left-aligned text.
template<typename T>
inline void evab::Grid::TextLeft (
T aText,
unsigned char aIsFocused=0
)
function TextRight¶
Draws right-aligned text.
template<typename T>
inline void evab::Grid::TextRight (
T aText,
unsigned char aIsFocused=0
)
The documentation for this class was generated from the following file src/evabGrid.h