FTXUI  4.1.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 Button (ConstStringRef label, std::function< void()> on_click, Ref< ButtonOption > option)
 Draw a button. Execute a function when clicked.
 
Component Checkbox (ConstStringRef label, bool *checked, Ref< CheckboxOption > option)
 Draw checkable element.
 
Component Input (StringRef content, ConstStringRef placeholder, Ref< InputOption > option)
 An input box for editing text.
 
Component Menu (ConstStringListRef entries, int *selected, Ref< MenuOption > option)
 A list of text. The focused element is selected.
 
Component MenuEntry (ConstStringRef label, Ref< MenuEntryOption > option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component Dropdown (ConstStringListRef entries, int *selected)
 
Component Radiobox (ConstStringListRef entries, int *selected, Ref< RadioboxOption > option)
 A list of element, where only one can be selected.
 
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 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 ResizableSplit (ResizableSplitOption options)
 A split in between two components.
 
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. @params child the compoennt to decorate. @params show a boolean. |child| is shown when |show| is true.
 
Component Maybe (Component, std::function< bool()>)
 
ComponentDecorator Maybe (const bool *show)
 Decorate a component. It is shown only when |show| is true. @params show a boolean. |child| is shown when |show| is true.
 
ComponentDecorator Maybe (std::function< bool()> show)
 Decorate a component. It is shown only when the |show| function returns true. @params show a function returning whether the decoratorated component should be shown.
 
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. Gives the ability to know if it is hovered by the mouse.
 
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.