11 : entries_(std::move(entries)), selected_(selected) {
15 checkbox_ =
Checkbox(&title_, &show_, option),
16 radiobox_ =
Radiobox(entries_, selected_);
18 Add(Container::Vertical({
20 Maybe(radiobox_, &show_),
25 title_ = entries_[*selected_];
37 checkbox_->Render() |
border,
51 return Make<Impl>(std::move(entries), selected);
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
An adapter. Reference a list of strings.
Component Checkbox(ConstStringRef label, bool *checked, Ref< CheckboxOption > option={})
Draw checkable element.
Component Radiobox(ConstStringListRef entries, int *selected_, Ref< RadioboxOption > option={})
A list of element, where only one can be selected.
std::string style_unchecked
Prefix for a "unchecked" state.
Element vscroll_indicator(Element)
Add a filter that will invert the foreground and the background colors.
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< Node > Element
std::string style_checked
Prefix for a "checked" state.
Component Dropdown(ConstStringListRef entries, int *selected)
Element filler()
An element that will take expand proportionnally 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 &node)
Display an element on a ftxui::Screen.
Decorator size(Direction, Constraint, int value)
Apply a constraint on the size of an element.
Element border(Element)
Draw a border around the element.
std::shared_ptr< ComponentBase > Component
Element vbox(Elements)
A container displaying elements vertically one by one.
Option for the Checkbox component.
Component Maybe(Component child, bool *show)