|
TachyonUI 0.1.0
High-performance UI for building tools.
|
User-owned, persistent state of one table: column widths, selection, sort, options. More...
#include <gui_controls/gui_table_types.h>
Classes | |
| struct | TreeRowInfo |
| Per-row metadata from TreeCell(). More... | |
| struct | CellLookupEntry |
| Cell-mode click dispatch: cell-element ID -> (rowID, columnIdx). More... | |
| class | LazyReorderFn |
| A ReorderColumnsFn that costs one pointer when unset; assign it like a std::function: state.onReorderColumns = [&](int from, int to) { ... };. More... | |
| struct | Internal |
| Written by the table each frame; not part of the API. More... | |
Public Types | |
| using | TreeRowMap = std::unordered_map<tachyon::ID, TreeRowInfo> |
| row ID -> tree info | |
| using | CellLookupMap = std::unordered_map<tachyon::ID, CellLookupEntry> |
| using | ReorderColumnsFn = std::function<void(int fromCol, int toCol)> |
| Moves column fromCol to toCol in the caller's column array. | |
Public Member Functions | |
| tachyon::ID | SectionBodyID (int i) const noexcept |
| Body element ID of section i (its scroll container); Invalid when out of range. | |
| void | SetSectionBodyID (int i, tachyon::ID id) |
| Used by the table. | |
| TreeRowMap & | EnsureTreeRowInfo () |
| The tree-row map, allocated on first use; read it with FindTreeRow(). | |
| CellLookupMap & | EnsureCellLookup () |
| The cell lookup map, allocated on first use; read it with FindCell(). | |
| tachyon::ID | RowIDForIndex (int rowIdx) const noexcept |
| A row's sub-range ID, usable outside a frame (unlike IDManager::GetSubID). | |
| tachyon::ID | RowIDInRange (int rowIdx) const noexcept |
| As RowIDForIndex, without the bound on last frame's row count. | |
| int | VisualToDataset (int visualIdx) const noexcept |
| Maps a visual (sorted) row index to its dataset index; identity when not sorted. | |
| int | DatasetToVisual (int datasetIdx) const noexcept |
| Maps a dataset row index to its visual index, or -1 when absent; O(N) when sorted. | |
| void | InvalidateRowOrder () noexcept |
| Rebuilds the sort permutation next frame; call after changing sorted data. | |
| void | RestartFollowTail () noexcept |
| With followTail: scrolls to (and selects) the last row next frame, as on first show. | |
| const TreeRowInfo * | FindTreeRow (tachyon::ID id) const noexcept |
| Tree metadata of row id from TreeCell(); nullptr when not found. | |
| const CellLookupEntry * | FindCell (tachyon::ID id) const noexcept |
| Cell-mode: the row and column of a cell element; nullptr when not found. | |
Public Attributes | |
| 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 of a headerless table. | |
| 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). | |
| struct tachyon::TableState::Internal | internal |
Static Public Attributes | |
| static constexpr int | kMaxTableSections = 8 |
| max sections (see VirtualTableColumn::sectionId) | |
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.
| using tachyon::TableState::TreeRowMap = std::unordered_map<tachyon::ID, TreeRowInfo> |
row ID -> tree info
| using tachyon::TableState::CellLookupMap = std::unordered_map<tachyon::ID, CellLookupEntry> |
| using tachyon::TableState::ReorderColumnsFn = std::function<void(int fromCol, int toCol)> |
Moves column fromCol to toCol in the caller's column array.
|
inlinenoexcept |
Body element ID of section i (its scroll container); Invalid when out of range.
|
inline |
Used by the table.
|
inline |
The tree-row map, allocated on first use; read it with FindTreeRow().
|
inline |
The cell lookup map, allocated on first use; read it with FindCell().
|
inlinenoexcept |
A row's sub-range ID, usable outside a frame (unlike IDManager::GetSubID).
Invalid when out of range.
|
inlinenoexcept |
As RowIDForIndex, without the bound on last frame's row count.
|
inlinenoexcept |
Maps a visual (sorted) row index to its dataset index; identity when not sorted.
|
inlinenoexcept |
Maps a dataset row index to its visual index, or -1 when absent; O(N) when sorted.
|
inlinenoexcept |
Rebuilds the sort permutation next frame; call after changing sorted data.
|
inlinenoexcept |
With followTail: scrolls to (and selects) the last row next frame, as on first show.
|
inlinenoexcept |
Tree metadata of row id from TreeCell(); nullptr when not found.
|
inlinenoexcept |
Cell-mode: the row and column of a cell element; nullptr when not found.
|
staticconstexpr |
max sections (see VirtualTableColumn::sectionId)
| std::vector<int32_t> tachyon::TableState::columnWidths |
Per-column widths in CSS px, persisted; they follow column reorders.
| MultiSelectState* tachyon::TableState::multiSelect = nullptr |
When set, Ctrl/Shift-click selects multiple rows into it.
| ItemDragDropConfig* tachyon::TableState::rowDragDrop = nullptr |
When set with a non-zero payloadType, rows become drag sources and drop targets.
| tachyon::ID tachyon::TableState::selectedRowID = tachyon::ID::Invalid() |
The selected (cursor) row; keyboard navigation moves it.
| 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.
| int tachyon::TableState::selectedColumn = 0 |
cell-mode only, ignored in row mode
| int tachyon::TableState::sortColumn = -1 |
-1 = unset; VirtualTable snaps an unset or unsortable value to the first sortable column.
| TableSelectionMode tachyon::TableState::selectionMode = TableSelectionMode::Row |
| bool tachyon::TableState::sortDescending = false |
sort direction of sortColumn
| bool tachyon::TableState::selectionBar = false |
Row mode: an accent bar on a selected row's left.
| StyleRef tachyon::TableState::rowStyle = StyleRef::Invalid() |
Every row's backdrop, in place of the striped .table-row pair.
| StyleRef tachyon::TableState::cellStyle = StyleRef::Invalid() |
Every body cell, in place of .table-cell; the row height follows it.
| bool tachyon::TableState::showHeaders = true |
False omits the header row (and with it reorder, resize and sort).
| bool tachyon::TableState::columnSeparators = true |
1px lines between the columns of a headerless table.
| LazyReorderFn tachyon::TableState::onReorderColumns |
headers become drag-to-reorder when set
| std::function<void(tachyon::ID rowID)> tachyon::TableState::onRowDoubleClick |
Replaces the default double-click branch toggle (the chevron still toggles).
| struct tachyon::TableState::Internal tachyon::TableState::internal |