TinyMaterialDesign
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TableLayout Class Reference

Grid with explicit, independently-sized column widths and row heights. More...

#include <TableLayout.h>

Public Member Functions

 TableLayout (Bounds container, const int32_t *columnWidths, int columnCount, const int32_t *rowHeights, int rowCount, int32_t spacing=8)
 
Bounds cellRect (int row, int col) const
 Bounds for the cell at (row, col), 0-based.
 
int columns () const
 
int rows () const
 
int32_t totalWidth () const
 Total width needed for all columns.
 
int32_t totalHeight () const
 Total height needed for all rows.
 

Detailed Description

Grid with explicit, independently-sized column widths and row heights.

Not a widget - see GridLayout.h for the rationale. GridLayout assumes uniform cells and computes the column count for you; TableLayout is for dashboards mixing wide/narrow columns or short/tall rows, where you supply the sizes explicitly:

int32_t colW[] = {120, 80, 80}; int32_t rowH[] = {48, 96}; TableLayout table(Bounds(16, 56, 280, 200), colW, 3, rowH, 2); cell.bounds = table.cellRect(row, col);

Constructor & Destructor Documentation

◆ TableLayout()

TableLayout ( Bounds  container,
const int32_t *  columnWidths,
int  columnCount,
const int32_t *  rowHeights,
int  rowCount,
int32_t  spacing = 8 
)
inline

Member Function Documentation

◆ cellRect()

Bounds cellRect ( int  row,
int  col 
) const
inline

Bounds for the cell at (row, col), 0-based.

◆ columns()

int columns ( ) const
inline

◆ rows()

int rows ( ) const
inline

◆ totalHeight()

int32_t totalHeight ( ) const
inline

Total height needed for all rows.

◆ totalWidth()

int32_t totalWidth ( ) const
inline

Total width needed for all columns.


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