TachyonUI 0.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 and isOpen; 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::PendingRowClick
 Deferred row-click state for the drag-drop path: MouseDown primes it, MouseUp applies the selection unless a drag promoted in between. 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...

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.
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.

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.

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.

◆ 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; toggling isOpen needs no rebuild. O(n^2) worst case, fine for the hundreds-of-rows datasets these views target.

◆ 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.

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.