morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::Table Struct Reference

Keyed rows of cells under column headers. Each row's view is a Row whose children are the cells, one per column. More...

#include <view.hpp>

Public Attributes

std::vector< TableColumn > columns
 The columns, in order; set once.
std::shared_ptr< detail::ForEachModel const > rows
 The rows, the key function and the row view, type-erased; null shows no rows.
bool showHeader = true
 Whether the header row is drawn; set once. false suits several tables sharing one header, or a header a document draws itself.
Virtualization virtualize {}
 The row count and margin above which a row's widget is realized only near the visible range; set once. A row's own reactive state is unaffected either way. Only a backend that implements TableWidget::setOnVisibleRangeChanged ever dewindows a row; every other backend realizes every row regardless of this setting, exactly as before it existed.
SelectionMode selectionMode = SelectionMode::None
 How many rows the user can select; set once.
Prop< std::vector< Key > > selection
 The selected rows' keys. A key with no row selects nothing until such a row appears.
std::function< void(std::vector< Key >)> onSelectionChange
 Called with the keys the user selected.
std::function< void(Key)> onActivate
 Called with a row's key when the user activates it (Enter or a double click).
Common common {}
 Visibility, enablement, layout, drag-and-drop.

Detailed Description

Keyed rows of cells under column headers. Each row's view is a Row whose children are the cells, one per column.

Definition at line 888 of file view.hpp.

Member Data Documentation

◆ columns

std::vector<TableColumn> morph::ui::Table::columns

The columns, in order; set once.

Definition at line 890 of file view.hpp.

◆ rows

std::shared_ptr<detail::ForEachModel const> morph::ui::Table::rows

The rows, the key function and the row view, type-erased; null shows no rows.

Definition at line 892 of file view.hpp.

◆ showHeader

bool morph::ui::Table::showHeader = true

Whether the header row is drawn; set once. false suits several tables sharing one header, or a header a document draws itself.

Definition at line 895 of file view.hpp.

◆ virtualize

Virtualization morph::ui::Table::virtualize {}

The row count and margin above which a row's widget is realized only near the visible range; set once. A row's own reactive state is unaffected either way. Only a backend that implements TableWidget::setOnVisibleRangeChanged ever dewindows a row; every other backend realizes every row regardless of this setting, exactly as before it existed.

Definition at line 900 of file view.hpp.

◆ selectionMode

SelectionMode morph::ui::Table::selectionMode = SelectionMode::None

How many rows the user can select; set once.

Definition at line 902 of file view.hpp.

◆ selection

Prop<std::vector<Key> > morph::ui::Table::selection

The selected rows' keys. A key with no row selects nothing until such a row appears.

Definition at line 904 of file view.hpp.

◆ onSelectionChange

std::function<void(std::vector<Key>)> morph::ui::Table::onSelectionChange

Called with the keys the user selected.

Definition at line 906 of file view.hpp.

◆ onActivate

std::function<void(Key)> morph::ui::Table::onActivate

Called with a row's key when the user activates it (Enter or a double click).

Definition at line 908 of file view.hpp.

◆ common

Common morph::ui::Table::common {}

Visibility, enablement, layout, drag-and-drop.

Definition at line 910 of file view.hpp.


The documentation for this struct was generated from the following file: