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

A choice of one option. More...

#include <view.hpp>

Public Attributes

Prop< std::vector< SelectOption > > options
 The options, in order.
Prop< std::optional< Key > > selected
 The selected key, or none. A key outside options shows no selection.
std::function< void(Key)> onSelect
 Called with the key the user chose.
Action onOpen
 Called when the user opens the dropdown, whether or not it has options to show; a radio group is never opened. A hint, such as retrying a fetch of the options that failed: a backend may not report it.
SelectStyle style = SelectStyle::Dropdown
 Dropdown or radio; set once.
Prop< std::string > label
 The field's label: its visible caption while showLabel; a form's cell draws it otherwise, beside the input. Empty: none.
bool showLabel = false
 Whether the input draws label as a visible caption itself; set once. A form leaves it false, since its cell draws the caption.
FieldState field {}
 Read-only, required, errors and stale.
Common common {}
 Visibility, enablement, layout, drag-and-drop.

Detailed Description

A choice of one option.

Definition at line 499 of file view.hpp.

Member Data Documentation

◆ options

Prop<std::vector<SelectOption> > morph::ui::Select::options

The options, in order.

Definition at line 501 of file view.hpp.

◆ selected

Prop<std::optional<Key> > morph::ui::Select::selected

The selected key, or none. A key outside options shows no selection.

Definition at line 503 of file view.hpp.

◆ onSelect

std::function<void(Key)> morph::ui::Select::onSelect

Called with the key the user chose.

Definition at line 505 of file view.hpp.

◆ onOpen

Action morph::ui::Select::onOpen

Called when the user opens the dropdown, whether or not it has options to show; a radio group is never opened. A hint, such as retrying a fetch of the options that failed: a backend may not report it.

Definition at line 508 of file view.hpp.

◆ style

SelectStyle morph::ui::Select::style = SelectStyle::Dropdown

Dropdown or radio; set once.

Definition at line 510 of file view.hpp.

◆ label

Prop<std::string> morph::ui::Select::label

The field's label: its visible caption while showLabel; a form's cell draws it otherwise, beside the input. Empty: none.

Definition at line 513 of file view.hpp.

◆ showLabel

bool morph::ui::Select::showLabel = false

Whether the input draws label as a visible caption itself; set once. A form leaves it false, since its cell draws the caption.

Definition at line 516 of file view.hpp.

◆ field

FieldState morph::ui::Select::field {}

Read-only, required, errors and stale.

Definition at line 518 of file view.hpp.

◆ common

Common morph::ui::Select::common {}

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

Definition at line 520 of file view.hpp.


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