25 option.radiobox.selected = selected;
49 util::clamp(radiobox.selected(), 0,
int(radiobox.entries.size()) - 1);
50 title_ = radiobox.entries[selected_()];
71 (
event == Event::Character(
' ')) ||
85 open_ = checkbox.checked;
86 selected_ = radiobox.selected;
87 checkbox.checked = &*
open_;
88 radiobox.selected = &*selected_;
91 if (!checkbox.transform) {
94 auto t =
text(s.label);
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
virtual bool OnEvent(Event)
Called in response to an event.
An adapter. Reference a list of strings.
An adapter. Own or reference an mutable object.
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
constexpr const T & clamp(const T &v, const T &lo, const T &hi)
Element vscroll_indicator(Element)
Display a vertical scrollbar to the right. colors.
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
Component Maybe(Component, const bool *show)
Decorate a component |child|. It is shown only when |show| is true.
std::shared_ptr< Node > Element
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< ComponentBase > Component
Element bold(Element)
Use a bold font, for elements with more emphasis.
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
Element hbox(Elements)
A container displaying elements horizontally one by one.
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Element text(std::wstring text)
Display a piece of unicode text.
Component Dropdown(ConstStringListRef entries, int *selected)
A dropdown menu.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element filler()
An element that will take expand proportionally to the space left in a container.
Element frame(Element)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Component Checkbox(CheckboxOption options)
Draw checkable element.
Element border(Element)
Draw a border around the element.
Element vbox(Elements)
A container displaying elements vertically one by one.
Option for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox.
arguments for |ButtonOption::transform|, |CheckboxOption::transform|, |Radiobox::transform|,...
Represent an event. It can be key press event, a terminal resize, or more ...
static const Event Escape
static const Event Return
ConstStringListRef entries