4#ifndef FTXUI_COMPONENT_HPP
5#define FTXUI_COMPONENT_HPP
25struct MenuEntryOption;
27template <
class T,
class... Args>
28std::shared_ptr<T>
Make(Args&&... args) {
29 return std::make_shared<T>(std::forward<Args>(args)...);
57 std::function<
void()> on_click,
58 ButtonOption options = ButtonOption::Simple());
64 CheckboxOption options = CheckboxOption::Simple());
71 StringRef placeholder,
72 InputOption options = {});
78 MenuOption options = MenuOption::Vertical());
87 RadioboxOption options = {});
107 Slider(SliderOption<uint16_t>);
109 Slider(SliderOption<uint32_t>);
111 Slider(SliderOption<uint64_t>);
120 ConstRef<int> min = 0,
121 ConstRef<int> max = 100,
122 ConstRef<int> increment = 5);
126 ConstRef<float> min = 0.f,
127 ConstRef<float> max = 100.f,
128 ConstRef<float> increment = 5.f);
132 ConstRef<long> min = 0L,
133 ConstRef<long> max = 100L,
134 ConstRef<long> increment = 5L);
170Component Collapsible(ConstStringRef label,
178 std::function<
void()> on_enter,
179 std::function<
void()> on_leave);
182 std::function<
void(
bool)> on_change);
186 std::function<
void()> on_leave);
An adapter. Own or reference an mutable object.
#define FTXUI_EXPORT(component)
Component Button(ConstStringRef label, std::function< void()> on_click, ButtonOption options=ButtonOption::Simple())
Draw a button. Execute a function when clicked.
Component ResizableSplitTop(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
Component Horizontal(Components children, int *selector)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
Component Toggle(ConstStringListRef entries, int *selected)
An horizontal list of elements. The user can navigate through them.
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Component Checkbox(ConstStringRef label, bool *checked, CheckboxOption options=CheckboxOption::Simple())
Draw checkable element.
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Component ResizableSplitRight(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
Component Input(StringRef content, InputOption options={})
An input box for editing text.
Component Dropdown(ConstStringListRef entries, int *selected)
A dropdown menu.
Component Stacked(Components children)
A list of components to be stacked on top of each other. Events are propagated to the first component...
Component Radiobox(ConstStringListRef entries, int *selected_, RadioboxOption options={})
A list of element, where only one can be selected.
Component ResizableSplitBottom(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
Component Menu(ConstStringListRef entries, int *selected_, MenuOption options=MenuOption::Vertical())
A list of text. The focused element is selected.
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
Component Tab(Components children, int *selector)
A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
Component MenuEntry(ConstStringRef label, MenuEntryOption options={})
A specific menu entry. They can be put into a Container::Vertical to form a menu.
The FTXUI ftxui::Container:: namespace.
The FTXUI ftxui:: namespace.
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< Node > Element
std::function< Element(Element)> ElementDecorator
std::vector< Component > Components
Component ResizableSplit(ResizableSplitOption options)
A split in between two components.
Component operator|(Component component, ComponentDecorator decorator)
Component Slider(SliderOption< T > options)
A slider in any direction.
Component & operator|=(Component &component, ComponentDecorator decorator)
std::function< Component(Component)> ComponentDecorator
std::shared_ptr< ComponentBase > Component