FTXUI  5.0.0
C++ functional terminal UI.
Loading...
Searching...
No Matches
component.hpp File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ftxui
 
namespace  ftxui::Container
 

Typedefs

using ComponentDecorator = std::function< Component(Component)>
 
using ElementDecorator = std::function< Element(Element)>
 

Functions

template<class T , class... Args>
std::shared_ptr< T > Make (Args &&... args)
 
Component operator| (Component component, ComponentDecorator decorator)
 
Component operator| (Component component, ElementDecorator decorator)
 
Componentoperator|= (Component &component, ComponentDecorator decorator)
 
Componentoperator|= (Component &component, ElementDecorator decorator)
 
Component Vertical (Components children)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys.
 
Component Vertical (Components children, int *selector)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. This is useful for implementing a Menu for instance.
 
Component Horizontal (Components children)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
 
Component Horizontal (Components children, int *selector)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
 
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 index of the selected component. This is useful to implement tabs.
 
Component Stacked (Components children)
 A list of components to be stacked on top of each other. Events are propagated to the first component, then the second if not handled, etc. The components are drawn in the reverse order they are given. When a component take focus, it is put at the front, without changing the relative order of the other elements.
 
Component Button (ButtonOption option)
 Draw a button. Execute a function when clicked.
 
Component Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
 Draw a button. Execute a function when clicked.
 
Component Checkbox (CheckboxOption option)
 Draw checkable element.
 
Component Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
 Draw checkable element.
 
Component Input (InputOption option)
 An input box for editing text.
 
Component Input (StringRef content, InputOption option)
 An input box for editing text.
 
Component Input (StringRef content, StringRef placeholder, InputOption option)
 An input box for editing text.
 
Component Menu (MenuOption option)
 A list of text. The focused element is selected.
 
Component Menu (ConstStringListRef entries, int *selected, MenuOption option)
 A list of text. The focused element is selected.
 
Component MenuEntry (MenuEntryOption option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component MenuEntry (ConstStringRef label, MenuEntryOption option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component Radiobox (RadioboxOption option)
 A list of element, where only one can be selected.
 
Component Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
 A list of element, where only one can be selected.
 
Component Dropdown (ConstStringListRef entries, int *selected)
 A dropdown menu.
 
Component Dropdown (DropdownOption option)
 A dropdown menu.
 
Component Toggle (ConstStringListRef entries, int *selected)
 An horizontal list of elements. The user can navigate through them.
 
template<typename T >
Component Slider (SliderOption< T > options)
 A slider in any direction.
 
Component Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
 An horizontal slider.
 
Component Slider (ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)
 
Component Slider (ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)
 
Component ResizableSplit (ResizableSplitOption options)
 A split in between two components.
 
Component ResizableSplitLeft (Component main, Component back, int *main_size)
 An horizontal split in between two components, configurable using the mouse.
 
Component ResizableSplitRight (Component main, Component back, int *main_size)
 An horizontal split in between two components, configurable using the mouse.
 
Component ResizableSplitTop (Component main, Component back, int *main_size)
 An vertical split in between two components, configurable using the mouse.
 
Component ResizableSplitBottom (Component main, Component back, int *main_size)
 An vertical split in between two components, configurable using the mouse.
 
Component Renderer (Component child, std::function< Element()> render)
 Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
 
Component Renderer (std::function< Element()> render)
 Return a component, using |render| to render its interface.
 
Component Renderer (std::function< Element(bool)> render)
 Return a focusable component, using |render| to render its interface.
 
ComponentDecorator Renderer (ElementDecorator decorator)
 Decorate a component, by decorating what it renders.
 
Component CatchEvent (Component child, std::function< bool(Event)>)
 
ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
 Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
 
Component Maybe (Component child, const bool *show)
 Decorate a component |child|. It is shown only when |show| is true.
 
Component Maybe (Component child, std::function< bool()> show)
 Decorate a component |child|. It is shown only when |show| returns true.
 
ComponentDecorator Maybe (const bool *show)
 Decorate a component. It is shown only when |show| is true.
 
ComponentDecorator Maybe (std::function< bool()> show)
 Decorate a component. It is shown only when the |show| function returns true.
 
Component Modal (Component main, Component modal, const bool *show_modal)
 
ComponentDecorator Modal (Component modal, const bool *show_modal)
 
Component Collapsible (ConstStringRef label, Component child, Ref< bool > show=false)
 
Component Hoverable (Component component, bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Uses callbacks.
 
Component Hoverable (Component component, std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
 
ComponentDecorator Hoverable (std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Window (WindowOptions option)
 A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.