User-owned, persistent state of one table: column widths, selection, sort, options.
More...
#include <gui_controls/gui_table_types.h>
|
| std::vector< int32_t > | columnWidths |
| | Per-column widths in CSS px, persisted; they follow column reorders.
|
| MultiSelectState * | multiSelect = nullptr |
| | When set, Ctrl/Shift-click selects multiple rows into it.
|
| ItemDragDropConfig * | rowDragDrop = nullptr |
| | When set with a non-zero payloadType, rows become drag sources and drop targets.
|
| tachyon::ID | selectedRowID = tachyon::ID::Invalid() |
| | The selected (cursor) row; keyboard navigation moves it.
|
| bool | followTail = false |
| | Stick to the bottom: start at (and select) the last row, and follow new rows while at the bottom.
|
| int | selectedColumn = 0 |
| | cell-mode only, ignored in row mode
|
| int | sortColumn = -1 |
| | -1 = unset; VirtualTable snaps an unset or unsortable value to the first sortable column.
|
| TableSelectionMode | selectionMode = TableSelectionMode::Row |
| bool | sortDescending = false |
| | sort direction of sortColumn
|
| bool | selectionBar = false |
| | Row mode: an accent bar on a selected row's left.
|
| StyleRef | rowStyle = StyleRef::Invalid() |
| | Every row's backdrop, in place of the striped .table-row pair.
|
| StyleRef | cellStyle = StyleRef::Invalid() |
| | Every body cell, in place of .table-cell; the row height follows it.
|
| bool | showHeaders = true |
| | False omits the header row (and with it reorder, resize and sort).
|
| bool | columnSeparators = true |
| | 1px lines between the columns: all of them in a headerless table; with headers, the ones after columns that can't be resized (a resizable column keeps its sizer).
|
| LazyReorderFn | onReorderColumns |
| | headers become drag-to-reorder when set
|
| std::function< void(tachyon::ID rowID)> | onRowDoubleClick |
| | Replaces the default double-click branch toggle (the chevron still toggles).
|
| std::function< void(int row)> | contextMenu |
| | Builds the items of the table's context menu, opened by a right-click (or the Menu key) on a row, row its dataset index, or on the space below the rows, row -1.
|
| CommandMode | commandMode = CommandMode::Default |
| | The command manager's mode while the focus is in the table, for its own shortcuts (Delete for the selected rows, say); Default: none of its own.
|
| std::unordered_set< tachyon::ID > | openRows |
| | VirtualTreeView and WalkTreeViewVisibility: the rows open in this view, by TreeViewRowKey.
|
| struct tachyon::TableState::Internal | internal |
User-owned, persistent state of one table: column widths, selection, sort, options.
Keep it alive across frames; its internal member is not part of the API.
◆ TreeRowMap
◆ CellLookupMap
◆ ReorderColumnsFn
Moves column fromCol to toCol in the caller's column array.
◆ SectionBodyID()
| tachyon::ID tachyon::TableState::SectionBodyID |
( |
int | i | ) |
const |
|
inlinenoexcept |
Body element ID of section i (its scroll container); Invalid when out of range.
◆ SetSectionBodyID()
| void tachyon::TableState::SetSectionBodyID |
( |
int | i, |
|
|
tachyon::ID | id ) |
|
inline |
◆ EnsureTreeRowInfo()
| TreeRowMap & tachyon::TableState::EnsureTreeRowInfo |
( |
| ) |
|
|
inline |
The tree-row map, allocated on first use; read it with FindTreeRow().
◆ EnsureCellLookup()
The cell lookup map, allocated on first use; read it with FindCell().
◆ RowIDForIndex()
| tachyon::ID tachyon::TableState::RowIDForIndex |
( |
int | rowIdx | ) |
const |
|
inlinenoexcept |
◆ RowIDInRange()
| tachyon::ID tachyon::TableState::RowIDInRange |
( |
int | rowIdx | ) |
const |
|
inlinenoexcept |
As RowIDForIndex, without the bound on last frame's row count.
◆ VisualToDataset()
| int tachyon::TableState::VisualToDataset |
( |
int | visualIdx | ) |
const |
|
inlinenoexcept |
Maps a visual (sorted) row index to its dataset index; identity when not sorted.
◆ DatasetToVisual()
| int tachyon::TableState::DatasetToVisual |
( |
int | datasetIdx | ) |
const |
|
inlinenoexcept |
Maps a dataset row index to its visual index, or -1 when absent; O(N) when sorted.
◆ InvalidateRowOrder()
| void tachyon::TableState::InvalidateRowOrder |
( |
| ) |
|
|
inlinenoexcept |
Rebuilds the sort permutation next frame; call after changing sorted data.
◆ RestartFollowTail()
| void tachyon::TableState::RestartFollowTail |
( |
| ) |
|
|
inlinenoexcept |
With followTail: scrolls to (and selects) the last row next frame, as on first show.
◆ FindTreeRow()
Tree metadata of row id from TreeCell(); nullptr when not found.
◆ FindCell()
Cell-mode: the row and column of a cell element; nullptr when not found.
◆ kMaxTableSections
| int tachyon::TableState::kMaxTableSections = 8 |
|
staticconstexpr |
◆ columnWidths
| std::vector<int32_t> tachyon::TableState::columnWidths |
Per-column widths in CSS px, persisted; they follow column reorders.
◆ multiSelect
When set, Ctrl/Shift-click selects multiple rows into it.
◆ rowDragDrop
When set with a non-zero payloadType, rows become drag sources and drop targets.
◆ selectedRowID
The selected (cursor) row; keyboard navigation moves it.
◆ followTail
| bool tachyon::TableState::followTail = false |
Stick to the bottom: start at (and select) the last row, and follow new rows while at the bottom.
Scrolling up detaches; scrolling back down re-attaches.
◆ selectedColumn
| int tachyon::TableState::selectedColumn = 0 |
cell-mode only, ignored in row mode
◆ sortColumn
| int tachyon::TableState::sortColumn = -1 |
-1 = unset; VirtualTable snaps an unset or unsortable value to the first sortable column.
◆ selectionMode
◆ sortDescending
| bool tachyon::TableState::sortDescending = false |
sort direction of sortColumn
◆ selectionBar
| bool tachyon::TableState::selectionBar = false |
Row mode: an accent bar on a selected row's left.
◆ rowStyle
Every row's backdrop, in place of the striped .table-row pair.
◆ cellStyle
Every body cell, in place of .table-cell; the row height follows it.
◆ showHeaders
| bool tachyon::TableState::showHeaders = true |
False omits the header row (and with it reorder, resize and sort).
◆ columnSeparators
| bool tachyon::TableState::columnSeparators = true |
1px lines between the columns: all of them in a headerless table; with headers, the ones after columns that can't be resized (a resizable column keeps its sizer).
◆ onReorderColumns
headers become drag-to-reorder when set
◆ onRowDoubleClick
| std::function<void(tachyon::ID rowID)> tachyon::TableState::onRowDoubleClick |
Replaces the default double-click branch toggle (the chevron still toggles).
◆ contextMenu
| std::function<void(int row)> tachyon::TableState::contextMenu |
Builds the items of the table's context menu, opened by a right-click (or the Menu key) on a row, row its dataset index, or on the space below the rows, row -1.
No menu when unset.
◆ commandMode
The command manager's mode while the focus is in the table, for its own shortcuts (Delete for the selected rows, say); Default: none of its own.
◆ openRows
| std::unordered_set<tachyon::ID> tachyon::TableState::openRows |
VirtualTreeView and WalkTreeViewVisibility: the rows open in this view, by TreeViewRowKey.
Each view of the same rows opens and closes them on its own.
◆ internal
The documentation for this struct was generated from the following file: