TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_table_types.h
Go to the documentation of this file.
1#pragma once
2
3#include <gui_core/gui_id.h>
14
15#include <gui_controls/gui_widget_state_types.h> // MultiSelectState, ItemDragDropConfig, DoubleClickTracker, TreeDropPosition
16
17#include <array>
18#include <cassert>
19#include <functional>
20#include <memory>
21#include <optional>
22#include <unordered_map>
23#include <vector>
24
25// Table widget data model: column descriptors, the user-owned persistent
26// TableState, drag/drop state and the per-emit TableEmit.
27
28namespace tachyon
29{
32
33 // ---- Table widget: row x column data grid ----
34 //
35 // TableColumn describes a column; callers pass an array each frame.
36 // TableState is user-owned and persists widths and selection/sort state;
37 // its `internal` member is not part of the API.
38 //
40 enum class ColumnSizing : uint8_t {
48 };
49
51 enum class SectionSizing : uint8_t {
57 };
58
79
123
125 enum class TableSelectionMode : uint8_t
126 {
131 };
132
141
145 {
148 {
149 bool* isOpen = nullptr;
150 int depth = 0;
151 std::string* renameBuf = nullptr;
152 std::string renameSeed;
153 bool hasChildren = false;
154 };
155 using TreeRowMap = std::unordered_map<tachyon::ID, TreeRowInfo>;
156
160 using CellLookupMap = std::unordered_map<tachyon::ID, CellLookupEntry>;
161
163 using ReorderColumnsFn = std::function<void(int fromCol, int toCol)>;
164
168 {
169 public:
170 LazyReorderFn() = default;
171 LazyReorderFn(std::nullptr_t) noexcept {}
172
173 template <typename F,
174 typename = std::enable_if_t<!std::is_same_v<std::decay_t<F>, LazyReorderFn>>>
176 {
177 if (!_fn) _fn = std::make_unique<ReorderColumnsFn>();
178 *_fn = std::forward<F>(f);
179 return *this;
180 }
181 LazyReorderFn& operator=(std::nullptr_t) noexcept { _fn.reset(); return *this; }
182
183 explicit operator bool() const noexcept { return _fn && static_cast<bool>(*_fn); }
184 void operator()(int from, int to) const { (*_fn)(from, to); }
185 ReorderColumnsFn* get() noexcept { return _fn.get(); }
186 const ReorderColumnsFn* get() const noexcept { return _fn.get(); }
187 void reset() noexcept { _fn.reset(); }
188
189 private:
190 std::unique_ptr<ReorderColumnsFn> _fn;
191 };
192
193 static constexpr int kMaxTableSections = 8;
194
195 // ---- HOT: read every frame ----------------------------------
197 std::vector<int32_t> columnWidths;
206 bool followTail = false;
209 int sortColumn = -1;
211 bool sortDescending = false;
213 bool selectionBar = false;
219 bool showHeaders = true;
221 bool columnSeparators = true;
222
225 std::function<void(tachyon::ID rowID)> onRowDoubleClick;
226
228 struct Internal
229 {
233 int32_t lastViewportH = 0;
234 int32_t lastViewportW = 0;
239 int32_t actualRowHeight = 0;
243 bool anyHorzOverflow = false;
244 bool anyVertOverflow = false;
246 bool hasHeaders = true;
247 // followTail bookkeeping
248 bool followInit = false;
249 bool followPinned = true;
251
252 // Mode-specific, allocated on first use
253 std::unique_ptr<TreeRowMap> treeRowInfo;
255 std::vector<int> treeVisibleIdx;
256 std::unique_ptr<CellLookupMap> cellLookup;
257
258 // Per-table gesture state, so tables don't share click detection
262
265 std::unique_ptr<std::vector<int>> rowOrder;
266 int sortedColumn = -2;
267 bool sortedDescending = false;
270 bool rowOrderDirty = false;
271
274 std::unique_ptr<std::array<tachyon::ID, kMaxTableSections - 1>> extraSectionBodyIDs;
275 int8_t sectionCount = 0;
278 std::vector<tachyon::ElementRef> headerRefs;
280
281 // ---- Accessors ----------------------------------------------
283 tachyon::ID SectionBodyID(int i) const noexcept
284 {
285 if (i == 0) return internal.firstSectionBodyID;
287 return (*internal.extraSectionBodyIDs)[size_t(i - 1)];
288 }
289
291 {
292 assert(i >= 0 && i < kMaxTableSections);
293 if (i == 0) { internal.firstSectionBodyID = id; return; }
295 internal.extraSectionBodyIDs = std::make_unique<std::array<tachyon::ID, kMaxTableSections - 1>>();
296 (*internal.extraSectionBodyIDs)[size_t(i - 1)] = id;
297 }
298
301 {
302 if (!internal.treeRowInfo) internal.treeRowInfo = std::make_unique<TreeRowMap>();
303 return *internal.treeRowInfo;
304 }
305
307 {
308 if (!internal.cellLookup) internal.cellLookup = std::make_unique<CellLookupMap>();
309 return *internal.cellLookup;
310 }
311
314 tachyon::ID RowIDForIndex(int rowIdx) const noexcept
315 {
316 if (rowIdx >= internal.totalRowCount) return tachyon::ID::Invalid();
317 return RowIDInRange(rowIdx);
318 }
319
321 tachyon::ID RowIDInRange(int rowIdx) const noexcept
322 {
323 if (internal.rowsRangeID == tachyon::ID::Invalid() || rowIdx < 0) return tachyon::ID::Invalid();
324 tachyon::ID id{};
326 id.value.subRangeParts.index = static_cast<uint64_t>(rowIdx);
327 id.value.subRangeParts.parentHashValue = internal.rowsRangeID.value.rangedParts.hashValue;
328 return id;
329 }
330
332 int VisualToDataset(int visualIdx) const noexcept
333 {
334 if (!internal.rowOrder || visualIdx < 0 || visualIdx >= int(internal.rowOrder->size()))
335 return visualIdx;
336 return (*internal.rowOrder)[visualIdx];
337 }
338
340 int DatasetToVisual(int datasetIdx) const noexcept
341 {
342 if (!internal.rowOrder) return datasetIdx;
343 const auto& v = *internal.rowOrder;
344 for (size_t i = 0; i < v.size(); ++i)
345 if (v[i] == datasetIdx) return int(i);
346 return -1;
347 }
348
350 void InvalidateRowOrder() noexcept { internal.rowOrderDirty = true; }
351
353 void RestartFollowTail() noexcept
354 {
355 internal.followInit = false;
356 internal.followPinned = true;
358 }
359
361 const TreeRowInfo* FindTreeRow(tachyon::ID id) const noexcept
362 {
363 if (!internal.treeRowInfo) return nullptr;
364 auto it = internal.treeRowInfo->find(id);
365 return (it == internal.treeRowInfo->end()) ? nullptr : &it->second;
366 }
367
368 const CellLookupEntry* FindCell(tachyon::ID id) const noexcept
369 {
370 if (!internal.cellLookup) return nullptr;
371 auto it = internal.cellLookup->find(id);
372 return (it == internal.cellLookup->end()) ? nullptr : &it->second;
373 }
374 };
375
376 // ---- Column-reorder drag state (survives across frames) ----
377 //
378 // Cells use explicit grid placement, so instead of reordering elements the dragged
379 // column gets a Relative() offset. On drop, onReorderColumns fires.
384 int fromCol = -1;
385 int toCol = -1;
386 int32_t offsetX = 0;
388 std::vector<tachyon::IntRect> headerRects;
390 int minTarget = 0;
391 int maxTarget = 0;
395 int32_t startScrollX = 0;
396
398 bool IsDragging() const { return press.dragging; }
399 };
400
401 // ---- Persistent tree reorder drop state (survives across frames) ----
402 // Drives the drop indicator line; targetDepth indents it so After and Inside differ visibly.
409
410 // ---- Table: row x column data grid ----
411 //
412 // Transient state of one VirtualTable call. Event handlers run at end of frame and
413 // must never read it; they capture TableState pointers instead.
416 {
417 // Inputs
419 size_t columnCount = 0;
421
422 // Per-table derived values, filled by VirtualTable's prologue
423 bool dragActive = false;
424 bool cellMode = false;
427 int draggedCol = -1;
429 bool anyHorzOverflow = false;
430 bool anyVertOverflow = false;
431 bool showHeaders = true;
433 bool columnSeparators = true;
434
437
440
441 // Current position, read by Cell()/TreeCell()
442 int currentCol = 0;
447
450 bool isRecording = false;
454 int rowCount = 0;
455 std::vector<std::vector<std::function<void()>>> columnCells;
456 };
457
459}
A ReorderColumnsFn that costs one pointer when unset; assign it like a std::function: state....
Definition gui_table_types.h:168
const ReorderColumnsFn * get() const noexcept
Definition gui_table_types.h:186
void operator()(int from, int to) const
Definition gui_table_types.h:184
ReorderColumnsFn * get() noexcept
Definition gui_table_types.h:185
LazyReorderFn(std::nullptr_t) noexcept
Definition gui_table_types.h:171
LazyReorderFn & operator=(std::nullptr_t) noexcept
Definition gui_table_types.h:181
void reset() noexcept
Definition gui_table_types.h:187
LazyReorderFn & operator=(F &&f)
Definition gui_table_types.h:175
TableSelectionMode
Whether clicks, hover and keyboard navigation work on rows or on cells.
Definition gui_table_types.h:126
ColumnSizing
How a column's track is sized and whether it has a sizer at its right edge.
Definition gui_table_types.h:40
SectionSizing
How a section sizes itself in the bodies row; read from the section's first column.
Definition gui_table_types.h:51
@ Cell
A click selects one cell; arrows/Home/End move by cell; hover highlights the cell.
Definition gui_table_types.h:130
@ Row
A click selects the row; Up/Down/Home/End move by row; hover highlights the whole row.
Definition gui_table_types.h:128
@ Resizable
Fixed track at columnWidths[c], resizable via its sizer.
Definition gui_table_types.h:42
@ FitContent
Exactly the sum of its column widths (Stretch acts as Fixed); no H-scrollbar.
Definition gui_table_types.h:56
@ Scrollable
Shares leftover width with its siblings and scrolls horizontally on overflow.
Definition gui_table_types.h:54
TreeDropPosition
Where a tree reorder drop lands relative to the target row.
Definition gui_widget_state_types.h:44
@ None
Definition gui_widget_state_types.h:45
@ SubRange
one item of a Ranged ID: the range's hash plus an index
Definition gui_id.h:17
std::function< bool(ElementEvent &&input)> EventHandler
Element-level input handler used by the immediate-mode dispatcher; returns true when it consumed the ...
Definition gui_input_handler_func.h:35
KeyModifier
Modifier keys held, combined with |.
Definition gui_input_enums.h:26
@ None
Definition gui_input_enums.h:27
@ Row
Horizontal, left to right.
Definition gui_style.h:165
@ Fixed
out of flow in overlay space; doesn't scroll with the parent
Definition gui_style.h:219
@ Stretch
Stretch to fill container.
Definition gui_style.h:186
@ Resizable
Definition gui_window_flags.h:19
Definition gui_logging.h:24
Column-reorder drag in progress; internal, owned by the application.
Definition gui_table_types.h:381
tachyon::ID sectionBodyID
Body of the section being dragged in; drags never leave their section.
Definition gui_table_types.h:393
int fromCol
Definition gui_table_types.h:384
int32_t offsetX
pointer travel since the press, layout space
Definition gui_table_types.h:386
int minTarget
Inclusive target range, bounded by locked columns.
Definition gui_table_types.h:390
std::vector< tachyon::IntRect > headerRects
Header rects at drag start (layout space), for edge-crossing.
Definition gui_table_types.h:388
tachyon::ID tableID
Definition gui_table_types.h:383
int maxTarget
Definition gui_table_types.h:391
bool IsDragging() const
The press has moved the drag distance: a column move, not a sort click.
Definition gui_table_types.h:398
tachyon::PointerDrag press
the header's press; a drag once it moves the drag distance
Definition gui_table_types.h:382
int toCol
Definition gui_table_types.h:385
int32_t startScrollX
Scroll-X at drag start, to correct the cursor for mid-drag scrolling.
Definition gui_table_types.h:395
A size in CSS px.
Definition gui_units.h:18
Click-gesture tracker, owned per widget instance so instances (and tests) don't share it.
Definition gui_widget_state_types.h:75
An element's slot in ElementStorage: its depth and index within that depth.
Definition gui_element.h:127
static constexpr ElementRef Invalid()
Definition gui_element.h:135
Size of one grid column or row (CSS: -tachyon-grid-column-track / -row-track).
Definition gui_style.h:373
uint64_t hashValue
Definition gui_id.h:56
IDMode mode
Definition gui_id.h:60
A 64-bit element ID whose bit layout depends on its IDMode.
Definition gui_id.h:23
static constexpr ID Invalid()
The "no element" ID (all bits zero); also the default for optional ID parameters.
Definition gui_id.h:66
union tachyon::ID::Value value
Drag & drop setup for item-based views (tree, list, grid): items drag a payload and accept drops of t...
Definition gui_widget_state_types.h:55
Per-element overrides of style layout properties.
Definition gui_constraints.h:150
Selected item IDs of a multi-select view; user-owned, keep it alive across frames.
Definition gui_widget_state_types.h:22
Deferred row-click state for the drag-drop path: MouseDown primes it, MouseUp applies the selection u...
Definition gui_table_types.h:136
tachyon::KeyModifier mods
Definition gui_table_types.h:138
tachyon::ID rowID
Definition gui_table_types.h:137
bool dragPromoted
Definition gui_table_types.h:139
One press on an element that may become a drag.
Definition gui_pointer_drag.h:41
bool dragging
moved the drag distance (or a drag from the press on)
Definition gui_pointer_drag.h:46
A registered style, as StyleManager::Register returns it: indices into the shared style pools,...
Definition gui_style_ref.h:25
static constexpr StyleRef Invalid()
A reference to no style (all indices Invalid).
Definition gui_style_ref.h:31
A table column; callers pass an array of them each frame.
Definition gui_table_types.h:60
bool interactiveContent
Keeps cells hittable in row mode (where cells are NoInput so a click selects the row),...
Definition gui_table_types.h:71
std::string_view header
header text
Definition gui_table_types.h:61
CssPx maxWidth
resize upper limit
Definition gui_table_types.h:64
StyleRef columnBackground
Optional background strip spanning the whole body height, behind the cells and above the row backdrop...
Definition gui_table_types.h:74
CssPx initialWidth
starting width
Definition gui_table_types.h:62
StyleRef cellStyle
Optional style for this column's Cell(text) cells in place of the table's, for example right-aligned ...
Definition gui_table_types.h:77
bool locked
Can't be dragged, and other columns can't be dragged past it.
Definition gui_table_types.h:67
ColumnSizing sizing
Definition gui_table_types.h:68
CssPx minWidth
resize lower limit
Definition gui_table_types.h:63
bool sortable
clicking the header sorts by this column
Definition gui_table_types.h:65
Transient state of one table emit; internal.
Definition gui_table_types.h:416
bool anyVertOverflow
Definition gui_table_types.h:430
StyleRef cellStyleRef
Body text cell style; invalid falls back to theme.tableCellStyleRef.
Definition gui_table_types.h:436
tachyon::ID currentRowID
Definition gui_table_types.h:443
int directGridRow
Definition gui_table_types.h:445
bool columnSeparators
Copied from TableState::columnSeparators.
Definition gui_table_types.h:433
int draggedCol
Reorder-dragged column, or -1; emitted last so it paints on top.
Definition gui_table_types.h:427
TableState * userState
Definition gui_table_types.h:420
std::vector< std::vector< std::function< void()> > > columnCells
Definition gui_table_types.h:455
int currentCol
Definition gui_table_types.h:442
size_t columnCount
Definition gui_table_types.h:419
StyleRef style
Definition gui_table_types.h:452
tachyon::ID containerID
Definition gui_table_types.h:451
bool showHeaders
Definition gui_table_types.h:431
bool isRecording
Recording mode (BeginTable/Cell flow): cells are stored in columnCells[column][row] and replayed by E...
Definition gui_table_types.h:450
bool anyHorzOverflow
Copied from TableState::internal.anyHorzOverflow / anyVertOverflow (last frame).
Definition gui_table_types.h:429
int32_t lastColDragFixedWidth
Definition gui_table_types.h:425
tachyon::EventHandler currentRowHandler
Definition gui_table_types.h:444
VirtualTableColumn * columns
user-owned
Definition gui_table_types.h:418
int rowCount
Definition gui_table_types.h:454
tachyon::EventHandler sharedRowHandler
Definition gui_table_types.h:438
int directColStart
Definition gui_table_types.h:446
tachyon::EventHandler sharedCellHandler
Definition gui_table_types.h:439
LayoutOverride constraints
Definition gui_table_types.h:453
bool cellMode
Definition gui_table_types.h:424
bool dragActive
Definition gui_table_types.h:423
Cell-mode click dispatch: cell-element ID -> (rowID, columnIdx).
Definition gui_table_types.h:159
tachyon::ID rowID
Definition gui_table_types.h:159
int columnIdx
Definition gui_table_types.h:159
Written by the table each frame; not part of the API.
Definition gui_table_types.h:229
std::vector< tachyon::ElementRef > headerRefs
Header cell refs of the current frame, by column.
Definition gui_table_types.h:278
std::unique_ptr< CellLookupMap > cellLookup
populated in cell mode
Definition gui_table_types.h:256
tachyon::ID firstSectionBodyID
Section 0's body ID; sections 1 and up live in extraSectionBodyIDs.
Definition gui_table_types.h:273
int totalRowCount
Definition gui_table_types.h:238
int32_t lastViewportW
Definition gui_table_types.h:234
int sortedRowCount
Definition gui_table_types.h:268
bool anyVertOverflow
Definition gui_table_types.h:244
std::vector< int > treeVisibleIdx
VirtualTreeView: last frame's visible -> flat rows.
Definition gui_table_types.h:255
bool sortedDescending
Definition gui_table_types.h:267
int32_t lastViewportH
sampled by render-time draw
Definition gui_table_types.h:233
int sortedColumn
-2 = unbuilt; -1 = built-as-identity
Definition gui_table_types.h:266
int32_t actualRowHeight
Definition gui_table_types.h:239
std::unique_ptr< std::vector< int > > rowOrder
Visual -> dataset row permutation while sorted, else null.
Definition gui_table_types.h:265
PendingRowClick pendingRowClick
Definition gui_table_types.h:261
DoubleClickTracker treeCellClickTracker
Definition gui_table_types.h:260
tachyon::ID vertScrollbarID
Definition gui_table_types.h:232
int8_t sectionCount
Definition gui_table_types.h:275
bool followInit
Definition gui_table_types.h:248
bool followPinned
Definition gui_table_types.h:249
tachyon::ID rowsRangeID
Written by VirtualTable each frame, so keyboard navigation can address and scroll to rows outside the...
Definition gui_table_types.h:237
std::unique_ptr< std::array< tachyon::ID, kMaxTableSections - 1 > > extraSectionBodyIDs
Definition gui_table_types.h:274
tachyon::ID horzScrollbarID
Definition gui_table_types.h:231
bool rowOrderDirty
Set via InvalidateRowOrder().
Definition gui_table_types.h:270
DoubleClickTracker rowClickTracker
Definition gui_table_types.h:259
bool hasHeaders
VirtualTable's showHeaders, for keyboard scroll-into-view.
Definition gui_table_types.h:246
bool anyHorzOverflow
Set at render time when any section overflows; next frame emits a scrollbar only for an overflowing a...
Definition gui_table_types.h:243
int prevFollowRowCount
Definition gui_table_types.h:250
std::unique_ptr< TreeRowMap > treeRowInfo
populated by TreeCell()
Definition gui_table_types.h:253
tachyon::ID bodyID
canonical scroll-Y
Definition gui_table_types.h:230
Per-row metadata from TreeCell().
Definition gui_table_types.h:148
bool hasChildren
drives drag-drop zone shape (thirds vs halves)
Definition gui_table_types.h:153
int depth
nesting level, 0 = root
Definition gui_table_types.h:150
bool * isOpen
null for leaves
Definition gui_table_types.h:149
std::string renameSeed
original label, seeds rename Start()
Definition gui_table_types.h:152
std::string * renameBuf
null when not renameable
Definition gui_table_types.h:151
User-owned, persistent state of one table: column widths, selection, sort, options.
Definition gui_table_types.h:145
std::unordered_map< tachyon::ID, CellLookupEntry > CellLookupMap
Definition gui_table_types.h:160
std::vector< int32_t > columnWidths
Per-column widths in CSS px, persisted; they follow column reorders.
Definition gui_table_types.h:197
int VisualToDataset(int visualIdx) const noexcept
Maps a visual (sorted) row index to its dataset index; identity when not sorted.
Definition gui_table_types.h:332
StyleRef cellStyle
Every body cell, in place of .table-cell; the row height follows it.
Definition gui_table_types.h:217
bool followTail
Stick to the bottom: start at (and select) the last row, and follow new rows while at the bottom.
Definition gui_table_types.h:206
std::function< void(tachyon::ID rowID)> onRowDoubleClick
Replaces the default double-click branch toggle (the chevron still toggles).
Definition gui_table_types.h:225
int selectedColumn
cell-mode only, ignored in row mode
Definition gui_table_types.h:207
struct tachyon::TableState::Internal internal
const TreeRowInfo * FindTreeRow(tachyon::ID id) const noexcept
Tree metadata of row id from TreeCell(); nullptr when not found.
Definition gui_table_types.h:361
void InvalidateRowOrder() noexcept
Rebuilds the sort permutation next frame; call after changing sorted data.
Definition gui_table_types.h:350
std::unordered_map< tachyon::ID, TreeRowInfo > TreeRowMap
row ID -> tree info
Definition gui_table_types.h:155
tachyon::ID selectedRowID
The selected (cursor) row; keyboard navigation moves it.
Definition gui_table_types.h:203
TreeRowMap & EnsureTreeRowInfo()
The tree-row map, allocated on first use; read it with FindTreeRow().
Definition gui_table_types.h:300
int DatasetToVisual(int datasetIdx) const noexcept
Maps a dataset row index to its visual index, or -1 when absent; O(N) when sorted.
Definition gui_table_types.h:340
bool showHeaders
False omits the header row (and with it reorder, resize and sort).
Definition gui_table_types.h:219
void SetSectionBodyID(int i, tachyon::ID id)
Used by the table.
Definition gui_table_types.h:290
tachyon::ID RowIDForIndex(int rowIdx) const noexcept
A row's sub-range ID, usable outside a frame (unlike IDManager::GetSubID).
Definition gui_table_types.h:314
StyleRef rowStyle
Every row's backdrop, in place of the striped .table-row pair.
Definition gui_table_types.h:215
tachyon::ID RowIDInRange(int rowIdx) const noexcept
As RowIDForIndex, without the bound on last frame's row count.
Definition gui_table_types.h:321
TableSelectionMode selectionMode
Definition gui_table_types.h:210
static constexpr int kMaxTableSections
max sections (see VirtualTableColumn::sectionId)
Definition gui_table_types.h:193
bool sortDescending
sort direction of sortColumn
Definition gui_table_types.h:211
void RestartFollowTail() noexcept
With followTail: scrolls to (and selects) the last row next frame, as on first show.
Definition gui_table_types.h:353
CellLookupMap & EnsureCellLookup()
The cell lookup map, allocated on first use; read it with FindCell().
Definition gui_table_types.h:306
std::function< void(int fromCol, int toCol)> ReorderColumnsFn
Moves column fromCol to toCol in the caller's column array.
Definition gui_table_types.h:163
tachyon::ID SectionBodyID(int i) const noexcept
Body element ID of section i (its scroll container); Invalid when out of range.
Definition gui_table_types.h:283
const CellLookupEntry * FindCell(tachyon::ID id) const noexcept
Cell-mode: the row and column of a cell element; nullptr when not found.
Definition gui_table_types.h:368
MultiSelectState * multiSelect
When set, Ctrl/Shift-click selects multiple rows into it.
Definition gui_table_types.h:199
bool columnSeparators
1px lines between the columns of a headerless table.
Definition gui_table_types.h:221
int sortColumn
-1 = unset; VirtualTable snaps an unset or unsortable value to the first sortable column.
Definition gui_table_types.h:209
LazyReorderFn onReorderColumns
headers become drag-to-reorder when set
Definition gui_table_types.h:223
bool selectionBar
Row mode: an accent bar on a selected row's left.
Definition gui_table_types.h:213
ItemDragDropConfig * rowDragDrop
When set with a non-zero payloadType, rows become drag sources and drop targets.
Definition gui_table_types.h:201
Tree reorder drop target under the cursor; internal, owned by the application.
Definition gui_table_types.h:404
int targetDepth
Definition gui_table_types.h:407
TreeDropPosition position
Definition gui_table_types.h:406
tachyon::ID targetRowID
Definition gui_table_types.h:405
Written by the table each frame (end-of-frame handlers read it); not part of the API.
Definition gui_table_types.h:107
tachyon::ID sizerID
Shared by the header and body copies of the boundary after this column, so their hover state syncs.
Definition gui_table_types.h:113
tachyon::ID bodyID
Definition gui_table_types.h:110
int16_t dragOffsetX
Applied to every element of this column during a reorder drag.
Definition gui_table_types.h:118
GridTrack columnTrack
Resolved once per frame.
Definition gui_table_types.h:120
int32_t maxContentWidth
Widest cell content seen (text + tree prefix), for double-click-to-fit.
Definition gui_table_types.h:109
tachyon::ID headerCellID
Ranged, so it doesn't change when the dragged column is emitted last.
Definition gui_table_types.h:115
tachyon::ElementRef headerRef
Definition gui_table_types.h:116
A VirtualTable column: the TableColumn plus cell generator, sort order and section.
Definition gui_table_types.h:90
std::function< void(int rowIndex)> generateCell
Emits the cell of dataset row rowIndex; null in the BeginTable/Cell flow.
Definition gui_table_types.h:93
struct tachyon::VirtualTableColumn::Internal internal
Written by the table; not part of the API.
std::function< bool(int rowA, int rowB)> sortAscending
Ascending strict-weak ordering on dataset row indices; VirtualTable sorts with it.
Definition gui_table_types.h:97
int sectionId
Consecutive columns with the same sectionId form a section, side by side and scrolling independently.
Definition gui_table_types.h:101
SectionSizing sectionSizing
Read from the section's first column only.
Definition gui_table_types.h:103
TableColumn column
Definition gui_table_types.h:91
struct tachyon::ID::Value::RangedParts rangedParts
struct tachyon::ID::Value::SubRangeParts subRangeParts