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

The state of a value a user edits or reads: whether it may be changed, must be given, is wrong, or is being recomputed. More...

#include <view.hpp>

Public Attributes

Prop< bool > readonly = false
 Whether the user may not change the value. A read-only field shows its value and can take focus and have its text selected; it takes no edit, submit or commit.
Prop< bool > required = false
 Whether the field is marked as one that must be given. Only a mark: whether a value is missing is the application's to decide and show through errors.
Prop< std::vector< std::string > > errors
 The messages shown with the field, in order; empty shows none. Which errors show, and when, is decided before they reach this property.
Prop< bool > stale = false
 Whether the value shown is the last known one while a newer one is computed.

Detailed Description

The state of a value a user edits or reads: whether it may be changed, must be given, is wrong, or is being recomputed.

On text, which no user edits, readonly changes nothing; the other three mark it as they mark an input. A constant default calls no setter.

Definition at line 386 of file view.hpp.

Member Data Documentation

◆ readonly

Prop<bool> morph::ui::FieldState::readonly = false

Whether the user may not change the value. A read-only field shows its value and can take focus and have its text selected; it takes no edit, submit or commit.

Definition at line 389 of file view.hpp.

◆ required

Prop<bool> morph::ui::FieldState::required = false

Whether the field is marked as one that must be given. Only a mark: whether a value is missing is the application's to decide and show through errors.

Definition at line 392 of file view.hpp.

◆ errors

Prop<std::vector<std::string> > morph::ui::FieldState::errors

The messages shown with the field, in order; empty shows none. Which errors show, and when, is decided before they reach this property.

Definition at line 395 of file view.hpp.

◆ stale

Prop<bool> morph::ui::FieldState::stale = false

Whether the value shown is the last known one while a newer one is computed.

Definition at line 397 of file view.hpp.


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