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

formView: a FormSession rendered as a view tree (ui::Node), so one form draws on every frontend. More...

#include <algorithm>
#include <charconv>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <exception>
#include <memory>
#include <optional>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <variant>
#include <vector>
#include "../../reactive/control.hpp"
#include "../../ui/view.hpp"
#include "../../util/datetime.hpp"
#include "../layout.hpp"
#include "detail/text.hpp"
#include "field_layout.hpp"
#include "field_model.hpp"
#include "form_session.hpp"
#include "overrides.hpp"

Go to the source code of this file.

Classes

struct  morph::forms::FormViewOptions
 How formView lays a form out and labels its chrome. More...

Functions

ui::Node morph::forms::formView (FormSession &session, FormViewOptions options={})
 Renders session: the title (the options' title, else the schema's while showTitle), its fields laid out by group (sections as panels, consecutive tab groups as one tab bar, accordions as collapsible panels, the implicit group as a grid), the status line, the Submit button in explicit mode, and the last reply or error.

Detailed Description

formView: a FormSession rendered as a view tree (ui::Node), so one form draws on every frontend.

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

Definition in file form_view.hpp.

Function Documentation

◆ formView()

ui::Node morph::forms::formView ( FormSession & session,
FormViewOptions options = {} )
inlinenodiscard

Renders session: the title (the options' title, else the schema's while showTitle), its fields laid out by group (sections as panels, consecutive tab groups as one tab bar, accordions as collapsible panels, the implicit group as a grid), the status line, the Submit button in explicit mode, and the last reply or error.

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

Parameters
sessionThe session.
optionsOverrides, grid columns, the chrome's labels, the field layout.
Returns
The view.
Exceptions
std::invalid_argumentwhen options.inlineLabelWidth is below 1.

Definition at line 513 of file form_view.hpp.