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

wizardView: a WizardSession rendered as a view tree (ui::Node): the title and step indicator, the current step's form, and Back and Next. More...

#include <cstddef>
#include <cstdint>
#include <functional>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "../../ui/view.hpp"
#include "form_view.hpp"
#include "wizard.hpp"

Go to the source code of this file.

Classes

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

Functions

ui::Node morph::forms::wizardView (WizardSession &session, WizardViewOptions const &options={})
 Renders session: the header (title with the step's position, a step indicator), the current step's formView (one per step, mounted while it is current; the values live in the steps' sessions, so leaving a step loses nothing), and Back and Next, enabled by canBack and canNext.

Detailed Description

wizardView: a WizardSession rendered as a view tree (ui::Node): the title and step indicator, the current step's form, and Back and Next.

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

Definition in file wizard_view.hpp.

Function Documentation

◆ wizardView()

ui::Node morph::forms::wizardView ( WizardSession & session,
WizardViewOptions const & options = {} )
inlinenodiscard

Renders session: the header (title with the step's position, a step indicator), the current step's formView (one per step, mounted while it is current; the values live in the steps' sessions, so leaving a step loses nothing), and Back and Next, enabled by canBack and canNext.

Test ids: wizard_title, wizard_steps, wizard_step_<index> (the current step's form), wizardBack, wizardNext and wizard_last; the step'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.
optionsEvery step's form options, the chrome and the labels.
Returns
The view.

Definition at line 123 of file wizard_view.hpp.