FTXUI
0.8.1
C++ functional terminal UI.
|
Go to the documentation of this file. 1 #ifndef FTXUI_COMPONENT_HPP
2 #define FTXUI_COMPONENT_HPP
16 struct CheckboxOption;
20 struct RadioboxOption;
23 template <
class T,
class... Args>
24 std::shared_ptr<T>
Make(Args&&... args) {
25 return std::make_shared<T>(args...);
29 std::function<
void()> on_click,
30 Ref<ButtonOption> = {});
33 Ref<CheckboxOption> option = {});
35 ConstStringRef placeholder,
36 Ref<InputOption> option = {});
39 Ref<MenuOption> = {});
43 Ref<RadioboxOption> option = {});
46 Ref<ToggleOption> option = {});
48 Component Slider(ConstStringRef label, T* value, T min, T max, T increment);
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
Component ResizableSplitRight(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
std::shared_ptr< ComponentBase > Component
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Component MenuEntry(ConstStringRef label, Ref< MenuEntryOption >={})
std::shared_ptr< T > Make(Args &&... args)
Component Checkbox(ConstStringRef label, bool *checked, Ref< CheckboxOption > option={})
Draw checkable element.
Component Slider(ConstStringRef label, T *value, T min, T max, T increment)
An horizontal slider.
std::shared_ptr< Node > Element
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 Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Component Toggle(ConstStringListRef entries, int *selected, Ref< ToggleOption > option={})
An horizontal list of elements. The user can navigate through them.
Component ResizableSplitTop(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
Component Button(ConstStringRef label, std::function< void()> on_click, Ref< ButtonOption >={})
Draw a button. Execute a function when clicked.
std::vector< Component > Components
Component CatchEvent(Component child, std::function< bool(Event)>)
Component Radiobox(ConstStringListRef entries, int *selected_, Ref< RadioboxOption > option={})
A list of element, where only one can be selected.
Component Menu(ConstStringListRef entries, int *selected_, Ref< MenuOption >={})
A list of text. The focused element is selected.
Component ResizableSplitBottom(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
Component Input(StringRef content, ConstStringRef placeholder, Ref< InputOption > option={})
An input box for editing text.