TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
Tables, trees and grids

Columns, sorting, selection and data sources for tables, tree views and grid views. More...

Concepts

concept  tachyon::TreeUtils::TreeRowLike
 A flat tree row: the caller sets depth; RebuildTreeIndex derives the rest.

Classes

class  tachyon::FileIcons
 The OS's icon for a file or folder, registered with a text system as a picture icon (ITextSystem::RegisterIconFromPixels). More...
struct  tachyon::FileEntry
 A file or folder in a folder. More...
class  tachyon::IFileSystem
 What a file view reads and changes. More...
class  tachyon::MemoryFileSystem
 A file system kept in memory. More...
class  tachyon::FileThumbnails
 A file's thumbnail, registered with a text system as a picture icon (ITextSystem::RegisterIconFromPixels). More...
struct  tachyon::TableHelpers::VirtualRowRange
 Half-open [firstVisible, lastVisible) range of rows to emit. More...
struct  tachyon::TableColumn
 A table column; callers pass an array of them each frame. More...
struct  tachyon::VirtualTableColumn
 A VirtualTable column: the TableColumn plus cell generator, sort order and section. More...
struct  tachyon::TreeOpenRef
 Where a tree row's open state lives: a bool of the caller's (flag), or the rows a view has open (set, the row's key in it, as TableState::openRows keeps them). More...
struct  tachyon::TableState
 User-owned, persistent state of one table: column widths, selection, sort, options. More...
struct  tachyon::ColumnDragState
 Column-reorder drag in progress; internal, owned by the application. More...
struct  tachyon::TreeDropState
 Tree reorder drop target under the cursor; internal, owned by the application. More...
struct  tachyon::TableEmit
 Transient state of one table emit; internal. More...
struct  tachyon::TreeViewState
 Construction state of the current TreeView / ListView; internal. More...
struct  tachyon::GridViewState
 Construction state of the current GridView; internal. More...
struct  tachyon::GridItemRenameInfo
 Rename buffer and original name of a grid item; internal. More...
struct  tachyon::TreeViewRow
 One row of a flat-data tree view (VirtualTreeView); rows are in depth-first order. More...
struct  tachyon::GridViewVirtualState
 User-owned, persistent state of a virtualized GridView; keep it alive across frames. More...

Typedefs

using tachyon::PendingRowClick = Gesture<tachyon::KeyModifier>
 Deferred row click for the drag-drop path: MouseDown presses it on the row (keeping the modifiers held then), it becomes a drag once the row's drag starts, and MouseUp applies the selection only when it ends as a click.

Enumerations

enum class  tachyon::ColumnSizing : uint8_t { tachyon::ColumnSizing::Resizable , tachyon::ColumnSizing::Fixed , tachyon::ColumnSizing::Stretch }
 How a column's track is sized and whether it has a sizer at its right edge. More...
enum class  tachyon::SectionSizing : uint8_t { tachyon::SectionSizing::Scrollable , tachyon::SectionSizing::FitContent }
 How a section sizes itself in the bodies row; read from the section's first column. More...
enum class  tachyon::TableSelectionMode : uint8_t { tachyon::TableSelectionMode::Row , tachyon::TableSelectionMode::Cell }
 Whether clicks, hover and keyboard navigation work on rows or on cells. More...

Functions

std::string tachyon::JoinPath (std::string_view folder, std::string_view name)
 folder and name as one path.
std::string_view tachyon::ParentPath (std::string_view path)
 The folder path is in; "" for an entry in the root (and for the root).
std::string_view tachyon::FileName (std::string_view path)
 The last name in path.
VirtualRowRange tachyon::TableHelpers::ComputeVirtualRowRange (int32_t scrollY, int32_t viewportH, int32_t rowHeight, int totalRowCount, int bufferRows)
 The rows a virtualized list of totalRowCount fixed-height rows emits, plus bufferRows of over-draw on each side; all lengths in pixels.
int tachyon::TableHelpers::ComputeColumnInsertionIndex (int32_t mouseX, int fromCol, std::span< const IntRect > headerRects)
 Drop column for a column drag: the dragged column passes a neighbour once the mouse crosses that neighbour's far edge.
tachyon::ID tachyon::TreeViewRowKey (const TreeViewRow &row, size_t flat)
 How a view's TableState::openRows names the row at flat index flat: its own ID, or for a row without one, its position (a SubRange ID of no range, so no element's).
template<TreeRowLike Row>
void tachyon::TreeUtils::RebuildTreeIndex (std::vector< Row > &rows)
 Recomputes the derived fields (skipCount, ancestorLineMask, isLastSibling) from each row's depth.
template<TreeRowLike Row>
int tachyon::TreeUtils::ReorderTreeRow (std::vector< Row > &rows, int srcDs, int dstDs, tachyon::TreeDropPosition pos)
 Moves the subtree rooted at flat index srcDs to pos relative to row dstDs, shifting depths when the target depth differs; Inside/InsideLast open the target when its rows have an isOpen (open it in the view yourself when they don't).
std::string tachyon::SaveViewState (const NodeViewState &view)
 A view's own state as text, for a panel to keep with its layout (Panel::saveState and Panel::restoreState), and back.
bool tachyon::RestoreViewState (NodeViewState &view, std::string_view state)
std::string tachyon::SaveViewState (const TimelineViewState &view)
 The part of a timeline in view and its zoom slider.
bool tachyon::RestoreViewState (TimelineViewState &view, std::string_view state)
std::string tachyon::SaveViewState (const CurveViewState &view)
 The part of a curve plot in view in its editor. Empty until the editor has shown it.
bool tachyon::RestoreViewState (CurveViewState &view, std::string_view state)
std::string tachyon::SaveViewState (const ViewportCamera &camera)
 A viewport's camera: where it looks, from how far and which way, its field of view and whether it's orthographic.
bool tachyon::RestoreViewState (ViewportCamera &camera, std::string_view state)
std::string tachyon::SaveViewState (const GUIApplication::SettingsPanelState &settings)
 The settings page open, by its name.
bool tachyon::RestoreViewState (GUIApplication::SettingsPanelState &settings, std::string_view state)

Detailed Description

Columns, sorting, selection and data sources for tables, tree views and grid views.

Calls (members of tachyon::GUIApplication): BeginTable, BeginRow, Cell, TreeCell, VirtualTable, VirtualTreeView, BeginGridView, GridViewItem, VirtualGridView. Tree and grid views: Tree and grid views. Guide: Tables.

Typedef Documentation

◆ PendingRowClick

#include <gui_controls/gui_table_types.h>

Deferred row click for the drag-drop path: MouseDown presses it on the row (keeping the modifiers held then), it becomes a drag once the row's drag starts, and MouseUp applies the selection only when it ends as a click.

Internal.

Enumeration Type Documentation

◆ ColumnSizing

enum class tachyon::ColumnSizing : uint8_t
strong

#include <gui_controls/gui_table_types.h>

How a column's track is sized and whether it has a sizer at its right edge.

Enumerator
Resizable 

Fixed track at columnWidths[c], resizable via its sizer.

Fixed 

Fixed track at initialWidth; a 1px separator instead of a sizer.

Stretch 

1fr track with initialWidth as the floor; a 1px separator.

The last column is always Stretch.

◆ SectionSizing

enum class tachyon::SectionSizing : uint8_t
strong

#include <gui_controls/gui_table_types.h>

How a section sizes itself in the bodies row; read from the section's first column.

Enumerator
Scrollable 

Shares leftover width with its siblings and scrolls horizontally on overflow.

Its last column is implicitly Stretch.

FitContent 

Exactly the sum of its column widths (Stretch acts as Fixed); no H-scrollbar.

◆ TableSelectionMode

enum class tachyon::TableSelectionMode : uint8_t
strong

#include <gui_controls/gui_table_types.h>

Whether clicks, hover and keyboard navigation work on rows or on cells.

Enumerator
Row 

A click selects the row; Up/Down/Home/End move by row; hover highlights the whole row.

Cell 

A click selects one cell; arrows/Home/End move by cell; hover highlights the cell.

Function Documentation

◆ JoinPath()

std::string tachyon::JoinPath ( std::string_view folder,
std::string_view name )

#include <gui_controls/gui_file_system.h>

folder and name as one path.

◆ ParentPath()

std::string_view tachyon::ParentPath ( std::string_view path)

#include <gui_controls/gui_file_system.h>

The folder path is in; "" for an entry in the root (and for the root).

◆ FileName()

std::string_view tachyon::FileName ( std::string_view path)

#include <gui_controls/gui_file_system.h>

The last name in path.

◆ ComputeVirtualRowRange()

VirtualRowRange tachyon::TableHelpers::ComputeVirtualRowRange ( int32_t scrollY,
int32_t viewportH,
int32_t rowHeight,
int totalRowCount,
int bufferRows )

#include <gui_controls/gui_table_helpers.h>

The rows a virtualized list of totalRowCount fixed-height rows emits, plus bufferRows of over-draw on each side; all lengths in pixels.

A 0 viewportH (first frame) still yields a small slice so layout can measure. Empty when rowHeight <= 0.

◆ ComputeColumnInsertionIndex()

int tachyon::TableHelpers::ComputeColumnInsertionIndex ( int32_t mouseX,
int fromCol,
std::span< const IntRect > headerRects )

#include <gui_controls/gui_table_helpers.h>

Drop column for a column drag: the dragged column passes a neighbour once the mouse crosses that neighbour's far edge.

headerRects are in display order.

◆ TreeViewRowKey()

tachyon::ID tachyon::TreeViewRowKey ( const TreeViewRow & row,
size_t flat )
inline

#include <gui_controls/gui_tree_grid_types.h>

How a view's TableState::openRows names the row at flat index flat: its own ID, or for a row without one, its position (a SubRange ID of no range, so no element's).

◆ RebuildTreeIndex()

template<TreeRowLike Row>
void tachyon::TreeUtils::RebuildTreeIndex ( std::vector< Row > & rows)

#include <gui_controls/gui_tree_utils.h>

Recomputes the derived fields (skipCount, ancestorLineMask, isLastSibling) from each row's depth.

Call once after structural edits; opening a row needs no rebuild. One pass from the last row up, so a large tree (a virtualized view's) costs O(n).

◆ ReorderTreeRow()

template<TreeRowLike Row>
int tachyon::TreeUtils::ReorderTreeRow ( std::vector< Row > & rows,
int srcDs,
int dstDs,
tachyon::TreeDropPosition pos )

#include <gui_controls/gui_tree_utils.h>

Moves the subtree rooted at flat index srcDs to pos relative to row dstDs, shifting depths when the target depth differs; Inside/InsideLast open the target when its rows have an isOpen (open it in the view yourself when they don't).

Rejects a drop on itself or into its own descendants. Call RebuildTreeIndex afterwards. Returns the moved row's new flat index, or -1 on rejection.

◆ SaveViewState() [1/5]

std::string tachyon::SaveViewState ( const NodeViewState & view)

#include <gui_controls/gui_view_state.h>

A view's own state as text, for a panel to keep with its layout (Panel::saveState and Panel::restoreState), and back.

Restore returns false, and changes nothing, for text it can't read; a value it doesn't know stays as it is.

panel.saveState    = [this] { return SaveViewState(graph); };
panel.restoreState = [this](std::string_view state) { RestoreViewState(graph, state); }; 

A node view's pan and zoom (NodeViewState::transform).

◆ RestoreViewState() [1/5]

bool tachyon::RestoreViewState ( NodeViewState & view,
std::string_view state )

◆ SaveViewState() [2/5]

std::string tachyon::SaveViewState ( const TimelineViewState & view)

#include <gui_controls/gui_view_state.h>

The part of a timeline in view and its zoom slider.

◆ RestoreViewState() [2/5]

bool tachyon::RestoreViewState ( TimelineViewState & view,
std::string_view state )

◆ SaveViewState() [3/5]

std::string tachyon::SaveViewState ( const CurveViewState & view)

#include <gui_controls/gui_view_state.h>

The part of a curve plot in view in its editor. Empty until the editor has shown it.

◆ RestoreViewState() [3/5]

bool tachyon::RestoreViewState ( CurveViewState & view,
std::string_view state )

◆ SaveViewState() [4/5]

std::string tachyon::SaveViewState ( const ViewportCamera & camera)

#include <gui_controls/gui_view_state.h>

A viewport's camera: where it looks, from how far and which way, its field of view and whether it's orthographic.

◆ RestoreViewState() [4/5]

bool tachyon::RestoreViewState ( ViewportCamera & camera,
std::string_view state )

◆ SaveViewState() [5/5]

std::string tachyon::SaveViewState ( const GUIApplication::SettingsPanelState & settings)

#include <gui_controls/gui_view_state.h>

The settings page open, by its name.

False when no page has that name: the one open stays.

◆ RestoreViewState() [5/5]

bool tachyon::RestoreViewState ( GUIApplication::SettingsPanelState & settings,
std::string_view state )