Table.hpp
Specs for the Table widget.
TableInfo is the core information for a table and has two helper classes: TableRowInfo and TableDataInfo. The Table class is a smart pointer to a TableInfo object.
A Table is composed of a series of rows, each with the same number of columns. TableDataInfo may be multiple cells wide/tall, masking other cells.
- Todo:
Tables should more directly manage internal slates rather than just adding divs and then having them filled in.
TextTables should be created that simply use text in cells, radically speeding up printing of such tables (and covering 80% of use cases).
IDEALLY: Make a single table that will look at what each cell is pointing to (table or text) and write out what it needs to, in place.
Add a ClearColumn method, as well as other column functionality.
Add an operator[] to table that returns the appropriate row (and one to row for cell).
-
class TableWidget : public internal::WidgetFacet<TableWidget>
- #include <Table.hpp>
Subclassed by Table
Public Types
-
using INFO_TYPE = internal::TableInfo
Public Functions
-
inline TableWidget(const TableWidget &in)
-
inline TableWidget()
-
inline virtual ~TableWidget()
-
inline size_t GetNumCols() const
-
inline size_t GetNumRows() const
-
inline size_t GetNumCells() const
-
inline virtual void PrepareAppend() override
-
inline size_t GetCurRow() const
Determine which row currently has focus.
-
inline size_t GetCurCol() const
Determine which column currently has focus.
-
inline void ClearTable()
-
inline void ClearRows()
-
inline void ClearRow(size_t r)
-
inline void ClearCol(size_t c)
-
inline void ClearRowGroup(size_t r)
-
inline void ClearColGroup(size_t c)
-
inline void ClearCells()
-
inline void ClearCell(size_t r, size_t c)
-
TableCell GetCell(size_t r, size_t c) const
Focus on a specific cell in the table.
-
TableRow GetRow(size_t r) const
Focus on a specific row in the table.
-
TableCol GetCol(size_t c) const
Focus on a specific column in the table.
-
TableRowGroup GetRowGroup(size_t r) const
Focus on a specific group of rows in the table.
-
TableColGroup GetColGroup(size_t c) const
Focus on a specific group of columns in the table.
-
Widget AddText(size_t r, size_t c, const std::string &text)
Add text to a specified cell in the table.
-
Widget AddHeader(size_t r, size_t c, const std::string &text)
Set a specified cell to be a table header.
Protected Types
-
using parent_t = internal::WidgetFacet<TableWidget>
Protected Functions
-
inline internal::TableInfo *Info()
Get a properly cast version of info.
-
inline internal::TableInfo *const Info() const
-
inline TableWidget(internal::TableInfo *in_info, size_t _row = 0, size_t _col = 0)
-
inline void DoCSS(const std::string &setting, const std::string &value) override
Apply CSS to appropriate component based on current state.
-
using INFO_TYPE = internal::TableInfo
-
class Table : public TableWidget
- #include <Table.hpp>
Public Functions
-
inline Table(const TableWidget &in)
-
inline Table(internal::TableInfo *in_info, size_t _row, size_t _col)
-
inline Table()
-
template<typename SETTING_TYPE>
inline Table &RowCSS(size_t row_id, const std::string &setting, SETTING_TYPE &&value) Apply CSS to target row.
-
template<typename SETTING_TYPE>
inline Table &CellCSS(size_t row_id, [[maybe_unused]] size_t col_id, const std::string &setting, SETTING_TYPE &&value) Apply CSS to target cell.
-
template<typename SETTING_TYPE>
inline Table &RowsCSS(const std::string &setting, SETTING_TYPE &&value) Apply CSS to all rows.
-
template<typename SETTING_TYPE>
inline Table &CellsCSS(const std::string &setting, SETTING_TYPE &&value) Apply CSS to all cells.
-
inline Table(const TableWidget &in)