ControlsΒΆ

Controls are the small widgets of a form: what the user clicks, ticks, drags, types or picks, and what shows a value back. Each one is a field whose type picks the widget.

Widget

For

Field type

Button

an action, or a toggle that stays pressed

ui::Button

Checkbox

on or off

bool, ui::Checkbox

Slider

a number in a range, dragged

ui::Slider<T>

Spin box

a number, typed or stepped

ui::SpinBox<T>

Text field

one line of text, or a password

ui::TextField<>, ui::Password<>

Text area

a few lines of text

ui::TextArea<>

Combo box

free text, with suggestions

ui::ComboBox

Choices

one option among several

an enum, ui::Radio<E>, ui::RadioGroup, ui::Choice

Color

a color

core::Color

Date and time

a day, a time of day

std::chrono::year_month_day, ui::TimeOfDay

Label

read-only text

std::string, ui::Label<>

Link

text that opens a URL

ui::Link

Progress bar

how far along work is

ui::ProgressBar

Picture

an image

ui::Picture

What every control shares, from tooltips to greying out, is in What every widget does.