|
FTXUI 6.1.9
C++ functional terminal UI.
|
Please check the tutorial of the ftxui/component module.
Functions | |
| FTXUI_EXPORT (COMPONENT) void RequestAnimationFrame() | |
| RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle. | |
| class | FTXUI_EXPORT (COMPONENT) ComponentBase = {}) |
| It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event. | |
| 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 | CatchEvent (Component child, std::function< bool(Event event)> on_event) |
| Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise. | |
| 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 | Checkbox (CheckboxOption option) |
| Draw checkable element. | |
| Component | Checkbox (ConstStringRef label, bool *checked, CheckboxOption option) |
| 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 '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 | Dropdown (ConstStringListRef entries, int *selected) |
| A dropdown menu. | |
| Component | Dropdown (DropdownOption option) |
| A dropdown menu. | |
| 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. | |
| 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) |
| 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 (std::function< void(bool)> on_change) |
| Wrap a component. Gives the ability to know if it is hovered by the mouse. | |
| 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 | Maybe (Component child, std::function< bool()> show) |
| Decorate a component |child|. It is shown only when |show| returns true. | |
| ComponentDecorator | Maybe (std::function< bool()> show) |
| Decorate a component. It is shown only when the |show| function returns true. | |
| Component | Maybe (Component child, const bool *show) |
| Decorate a component |child|. It is shown only when |show| is true. | |
| ComponentDecorator | Maybe (const bool *show) |
| Decorate a component. It is shown only when |show| is true. | |
| 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 | Toggle (ConstStringListRef entries, int *selected) |
| An horizontal list of elements. The user can navigate through them. | |
| Component | MenuEntry (ConstStringRef label, MenuEntryOption option) |
| A specific menu entry. They can be put into a Container::Vertical to form a menu. | |
| Component | MenuEntry (MenuEntryOption option) |
| A specific menu entry. They can be put into a Container::Vertical to form a menu. | |
| FTXUI_EXPORT(COMPONENT) ComponentDecorator Maybe(std Component | Modal (Component main, Component modal, const bool *show_modal) |
| ComponentDecorator | Modal (Component modal, const bool *show_modal) |
| 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 | Renderer (std::function< Element()> render) |
| Return a component, using |render| to render its interface. | |
| Component | Renderer (Component child, std::function< Element()> render) |
| Return a new Component, similar to |child|, but using |render| as the Component::Render() event. | |
| FTXUI_EXPORT(COMPONENT) Component Renderer(std 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 | 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 | Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment) |
| An horizontal slider. | |
| Component | Window (WindowOptions option) |
A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;. | |
| class FTXUI_EXPORT | ( | COMPONENT | ) |
RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle.
Components who haven't completed their animation can call this function to request a new frame to be drawn later.
When there is no new events and no animations to complete, no new frame is drawn.
The duration this animation step represents.
The duration this animation step represents.
Definition at line 27 of file animation.hpp.
| template FTXUI_EXPORT | ( | COMPONENT | ) | = {}) |
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event.
A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift, ctrl, meta).
Loop is a class that manages the event loop for a component.
Represent an event. It can be key press event, a terminal resize, or more ...
Option for the Dropdown component.
A dropdown menu is a checkbox opening/closing a radiobox.
State passed to the Window component's render function.
Option for the Radiobox component.
Option for the Input component.
Used to define style for the Input component.
Option for the Checkbox component.
Option for the AnimatedButton component.
Option for the Menu component.
Option for the MenuEntry component.
Option about a potentially animated color.
Option for the underline effect.
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|, |MenuOption|.
For example:
Useful documentation about xterm specification: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
It is responsible for running the component, handling events, and updating the screen.
The Loop class is designed to be used with an App object, which represents the terminal screen.
Example
< The label to display.
< The state of the button/checkbox/radiobox
< Whether the entry is the active one.
< Whether the entry is one focused by the user.
< Index of the entry when applicable or -1.
The list of entries.
The index of the selected entry.
Called when the selected entry changes.
Called when the user presses enter.
Called when the user change the state.
< Whether the input is hovered by the mouse.
< Whether the input is focused by the user.
< Whether the input is empty and displaying the placeholder.
Create the default input style:
A white on black style with high margins:
The content of the input.
The content of the input when it's empty.
< Obscure the input content using '*'.
< Whether the input can be multiline.
< Insert or overtype character mode.
Called when the content changes.
Called when the user presses enter.
Called when the selected entry changes.
< The element wrapped inside this window.
< The title of the window.
< Whether the window is the active one.
< Whether the window is being dragged.
< Whether the window is being resized.
< Whether the resizeable left side is hovered.
< Whether the resizeable right side is hovered.
< Whether the resizeable top side is hovered.
< Whether the resizeable down side is hovered.
< The component wrapped by this window.
< The title displayed by this window.
< The left side position of the window.
< The top side position of the window.
< The width of the window.
< The height of the window.
< Can the left side be resized?
< Can the right side be resized?
< Can the top side be resized?
< Can the down side be resized?
An optional function to customize how the window looks like:
Whether the dropdown is open or closed:
Supported terminal only.
Supported terminal only.
< The label to display.
< The state of the button/checkbox/radiobox
< Whether the entry is the active one.
< Whether the entry is one focused by the user.
< Index of the entry when applicable or -1.
The list of entries.
The index of the selected entry.
Called when the selected entry changes.
Called when the user presses enter.
Called when the user change the state.
< Whether the input is hovered by the mouse.
< Whether the input is focused by the user.
< Whether the input is empty and displaying the placeholder.
Create the default input style:
A white on black style with high margins:
The content of the input.
The content of the input when it's empty.
< Obscure the input content using '*'.
< Whether the input can be multiline.
< Insert or overtype character mode.
Called when the content changes.
Called when the user presses enter.
Called when the selected entry changes.
< The element wrapped inside this window.
< The title of the window.
< Whether the window is the active one.
< Whether the window is being dragged.
< Whether the window is being resized.
< Whether the resizeable left side is hovered.
< Whether the resizeable right side is hovered.
< Whether the resizeable top side is hovered.
< Whether the resizeable down side is hovered.
< The component wrapped by this window.
< The title displayed by this window.
< The left side position of the window.
< The top side position of the window.
< The width of the window.
< The height of the window.
< Can the left side be resized?
< Can the right side be resized?
< Can the top side be resized?
< Can the down side be resized?
An optional function to customize how the window looks like:
Whether the dropdown is open or closed:
Supported terminal only.
Supported terminal only.
Definition at line 1 of file captured_mouse.hpp.
| Component Button | ( | ButtonOption | option | ) |
Draw a button. Execute a function when clicked.
| option | Additional optional parameters. |
Definition at line 174 of file src/ftxui/component/button.cpp.
| Component Button | ( | ConstStringRef | label, |
| std::function< void()> | on_click, | ||
| ButtonOption | option ) |
Draw a button. Execute a function when clicked.
| label | The label of the button. |
| on_click | The action to execute when clicked. |
| option | Additional optional parameters. |
Definition at line 202 of file src/ftxui/component/button.cpp.
Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
| child | The wrapped component. |
| on_event | The function drawing the interface. |
Definition at line 54 of file catch_event.cpp.
| 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.
| on_event | The function drawing the interface. |
Definition at line 80 of file catch_event.cpp.
| Component Checkbox | ( | CheckboxOption | option | ) |
Draw checkable element.
| option | Additional optional parameters. |
Definition at line 110 of file src/ftxui/component/checkbox.cpp.
| Component Checkbox | ( | ConstStringRef | label, |
| bool * | checked, | ||
| CheckboxOption | option ) |
Draw checkable element.
| label | The label of the checkbox. |
| checked | Whether the checkbox is checked or not. |
| option | Additional optional parameters. |
Definition at line 137 of file src/ftxui/component/checkbox.cpp.
| 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.
| children | the list of components. |
Definition at line 317 of file container.cpp.
| 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.
| children | the list of components. |
| selector | A reference to the index of the selected children. |
Definition at line 340 of file container.cpp.
| 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.
| children | the list of components. |
Definition at line 360 of file container.cpp.
| 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.
| children | the list of components. |
| selector | A reference to the index of the selected children. |
Definition at line 382 of file container.cpp.
| 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.
| children | The list of components. |
| selector | The index of the drawn children. |
Definition at line 405 of file container.cpp.
| 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.
This should be used with the Window component.
| children | The list of components. |
Definition at line 432 of file container.cpp.
| Component Dropdown | ( | ConstStringListRef | entries, |
| int * | selected ) |
A dropdown menu.
| entries | The list of entries to display. |
| selected | The index of the selected entry. |
Definition at line 22 of file src/ftxui/component/dropdown.cpp.
| Component Dropdown | ( | DropdownOption | option | ) |
A dropdown menu.
| option | The options for the dropdown. |
Definition at line 33 of file src/ftxui/component/dropdown.cpp.
Wrap a component. Gives the ability to know if it is hovered by the mouse.
| component | The wrapped component. |
| hover | The value to reflect whether the component is hovered or not. |
Definition at line 33 of file hoverable.cpp.
| Component Hoverable | ( | Component | component, |
| std::function< void()> | on_enter, | ||
| std::function< void()> | on_leave ) |
Wrap a component. Uses callbacks.
| component | The wrapped component. |
| on_enter | Callback OnEnter |
| on_leave | Callback OnLeave |
Definition at line 76 of file hoverable.cpp.
| ComponentDecorator Hoverable | ( | bool * | hover | ) |
Wrap a component. Gives the ability to know if it is hovered by the mouse.
| hover | The value to reflect whether the component is hovered or not. |
Definition at line 131 of file hoverable.cpp.
| ComponentDecorator Hoverable | ( | 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.
| on_enter | is called when the mouse hover the component. |
| on_leave | is called when the mouse leave the component. |
Definition at line 155 of file hoverable.cpp.
Wrap a component. Gives the ability to know if it is hovered by the mouse.
| component | the wrapped component. |
| on_change | is called when the mouse enter or leave the component. |
Definition at line 178 of file hoverable.cpp.
| ComponentDecorator Hoverable | ( | std::function< void(bool)> | on_change | ) |
Wrap a component. Gives the ability to know if it is hovered by the mouse.
| on_change | is called when the mouse enter or leave the component. |
Definition at line 199 of file hoverable.cpp.
| Component Input | ( | InputOption | option | ) |
An input box for editing text.
| option | Additional optional parameters. |
Definition at line 590 of file src/ftxui/component/input.cpp.
| Component Input | ( | StringRef | content, |
| InputOption | option ) |
An input box for editing text.
| content | The editable content. |
| option | Additional optional parameters. |
Definition at line 618 of file src/ftxui/component/input.cpp.
| Component Input | ( | StringRef | content, |
| StringRef | placeholder, | ||
| InputOption | option ) |
An input box for editing text.
| content | The editable content. |
| placeholder | The placeholder text. |
| option | Additional optional parameters. |
Definition at line 645 of file src/ftxui/component/input.cpp.
Decorate a component |child|. It is shown only when |show| returns true.
| child | the component to decorate. |
| show | a function returning whether |child| should shown. |
Definition at line 21 of file src/ftxui/component/maybe.cpp.
| ComponentDecorator Maybe | ( | std::function< bool()> | show | ) |
Decorate a component. It is shown only when the |show| function returns true.
| show | a function returning whether the decorated component should be shown. |
Definition at line 57 of file src/ftxui/component/maybe.cpp.
Decorate a component |child|. It is shown only when |show| is true.
| child | the component to decorate. |
| show | a boolean. |child| is shown when |show| is true. |
Definition at line 74 of file src/ftxui/component/maybe.cpp.
| ComponentDecorator Maybe | ( | const bool * | show | ) |
Decorate a component. It is shown only when |show| is true.
| show | a boolean. |child| is shown when |show| is true. |
Definition at line 88 of file src/ftxui/component/maybe.cpp.
| Component Menu | ( | MenuOption | option | ) |
A list of text. The focused element is selected.
| option | a structure containing all the parameters. |
Definition at line 505 of file src/ftxui/component/menu.cpp.
| Component Menu | ( | ConstStringListRef | entries, |
| int * | selected, | ||
| MenuOption | option ) |
A list of text. The focused element is selected.
| entries | The list of entries in the menu. |
| selected | The index of the currently selected element. |
| option | Additional optional parameters. |
Definition at line 536 of file src/ftxui/component/menu.cpp.
| Component Toggle | ( | ConstStringListRef | entries, |
| int * | selected ) |
An horizontal list of elements. The user can navigate through them.
| entries | The list of selectable entries to display. |
| selected | Reference the selected entry. See also |Menu|. |
Definition at line 547 of file src/ftxui/component/menu.cpp.
| Component MenuEntry | ( | ConstStringRef | label, |
| MenuEntryOption | option ) |
A specific menu entry. They can be put into a Container::Vertical to form a menu.
| label | The text drawn representing this element. |
| option | Additional optional parameters. |
Definition at line 577 of file src/ftxui/component/menu.cpp.
| Component MenuEntry | ( | MenuEntryOption | option | ) |
A specific menu entry. They can be put into a Container::Vertical to form a menu.
| option | The parameters. |
Definition at line 607 of file src/ftxui/component/menu.cpp.
| ComponentDecorator Modal | ( | Component | modal, |
| const bool * | show_modal ) |
| Component Radiobox | ( | RadioboxOption | option | ) |
A list of element, where only one can be selected.
| option | The parameters |
NOLINTNEXTLINE
Definition at line 205 of file src/ftxui/component/radiobox.cpp.
| Component Radiobox | ( | ConstStringListRef | entries, |
| int * | selected, | ||
| RadioboxOption | option ) |
A list of element, where only one can be selected.
| entries | The list of entries in the list. |
| selected | The index of the currently selected element. |
| option | Additional optional parameters. |
Definition at line 237 of file src/ftxui/component/radiobox.cpp.
Return a component, using |render| to render its interface.
| render | The function drawing the interface. |
Definition at line 29 of file src/ftxui/component/renderer.cpp.
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
| child | The component to forward events to. |
| render | The function drawing the interface. |
Definition at line 61 of file src/ftxui/component/renderer.cpp.
Return a focusable component, using |render| to render its interface.
| render | The function drawing the interface, taking a boolean telling whether the component is focused or not. |
Definition at line 84 of file src/ftxui/component/renderer.cpp.
| ComponentDecorator Renderer | ( | ElementDecorator | decorator | ) |
Decorate a component, by decorating what it renders.
| decorator | the function modifying the element it renders. |
Definition at line 125 of file src/ftxui/component/renderer.cpp.
An horizontal split in between two components, configurable using the mouse.
| main | The main component of size |main_size|, on the left. |
| back | The back component taking the remaining size, on the right. |
| main_size | The size of the |main| component. |
Definition at line 199 of file src/ftxui/component/resizable_split.cpp.
An horizontal split in between two components, configurable using the mouse.
| main | The main component of size |main_size|, on the right. |
| back | The back component taking the remaining size, on the left. |
| main_size | The size of the |main| component. |
Definition at line 233 of file src/ftxui/component/resizable_split.cpp.
An vertical split in between two components, configurable using the mouse.
| main | The main component of size |main_size|, on the top. |
| back | The back component taking the remaining size, on the bottom. |
| main_size | The size of the |main| component. |
Definition at line 267 of file src/ftxui/component/resizable_split.cpp.
An vertical split in between two components, configurable using the mouse.
| main | The main component of size |main_size|, on the bottom. |
| back | The back component taking the remaining size, on the top. |
| main_size | The size of the |main| component. |
Definition at line 301 of file src/ftxui/component/resizable_split.cpp.
| Component Slider | ( | ConstStringRef | label, |
| Ref< int > | value, | ||
| ConstRef< int > | min, | ||
| ConstRef< int > | max, | ||
| ConstRef< int > | increment ) |
An horizontal slider.
| label | The name of the slider. |
| value | The current value of the slider. |
| min | The minimum value. |
| max | The maximum value. |
| increment | The increment when used by the cursor. |
Definition at line 257 of file src/ftxui/component/slider.cpp.
| Component Window | ( | WindowOptions | option | ) |
A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.
| option | A struct holding every parameters. |
Definition at line 311 of file src/ftxui/component/window.cpp.