morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
collection_view.hpp File Reference

collectionView: a CollectionSession rendered as a view tree (ui::Node): the title and collection actions, a table of the rows with their actions, the confirm dialog and the row editor, as a dialog or beside the table. More...

#include <cstddef>
#include <cstdint>
#include <exception>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "../../reactive/control.hpp"
#include "../../reactive/signal.hpp"
#include "../../ui/view.hpp"
#include "collection.hpp"
#include "form_view.hpp"

Go to the source code of this file.

Classes

struct  morph::forms::CollectionChrome
 Replacements for the parts of a collection view a host draws from its own UI kit. Each one left empty keeps the built-in part. More...
struct  morph::forms::CollectionViewOptions
 How collectionView draws a collection and labels its chrome. More...

Functions

ui::Node morph::forms::collectionView (CollectionSession &session, CollectionViewOptions options={})
 Renders session: the header (title, busy indicator, collection actions), the error line, the rows as a table (visible columns' exact cells, then Open and the row actions), the confirm dialog, and the row editor (formView of editor()) as a dialog for a collection, or beside the table, shown while a row is open, for a master-detail view.

Detailed Description

collectionView: a CollectionSession rendered as a view tree (ui::Node): the title and collection actions, a table of the rows with their actions, the confirm dialog and the row editor, as a dialog or beside the table.

Specified in docs/spec/forms/engine.md, "Rendering collections and wizards".

Definition in file collection_view.hpp.

Function Documentation

◆ collectionView()

ui::Node morph::forms::collectionView ( CollectionSession & session,
CollectionViewOptions options = {} )
inlinenodiscard

Renders session: the header (title, busy indicator, collection actions), the error line, the rows as a table (visible columns' exact cells, then Open and the row actions), the confirm dialog, and the row editor (formView of editor()) as a dialog for a collection, or beside the table, shown while a row is open, for a master-detail view.

Test ids: collection_title, collectionAction_<Action>, collection_error, collection_rows, cell_<field>_<rowKey>, rowOpen_<rowKey>, rowAction_<Action>_<rowKey>, confirmDialog, confirm_message, confirm_accept, confirm_cancel, editorDialog and detailForm; the editor's fields have their form ids.

The nodes bind to the session by pointer: mount the result after the session and destroy the mount before it.

Parameters
sessionThe session.
optionsThe editor's form options, the chrome and the labels.
Returns
The view.

Definition at line 282 of file collection_view.hpp.