FTXUI  5.0.0
C++ functional terminal UI.
elements.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  ftxui
 
namespace  ftxui::Dimension
 Define how the Screen's dimensions should look like.
 

Typedefs

using Element = std::shared_ptr< Node >
 
using Elements = std::vector< Element >
 
using Decorator = std::function< Element(Element)>
 
using GraphFunction = std::function< std::vector< int >(int, int)>
 

Enumerations

enum  BorderStyle {
  LIGHT , DASHED , HEAVY , DOUBLE ,
  ROUNDED , EMPTY
}
 
enum  WidthOrHeight { WIDTH , HEIGHT }
 
enum  Constraint { LESS_THAN , EQUAL , GREATER_THAN }
 

Functions

Element operator| (Element element, Decorator decorator)
 From an element, apply a decorator. More...
 
Element & operator|= (Element &e, Decorator d)
 Apply a decorator to an element. More...
 
Elements operator| (Elements elements, Decorator decorator)
 From a set of element, apply a decorator to every elements. More...
 
Decorator operator| (Decorator a, Decorator b)
 Compose two decorator into one. More...
 
Element text (std::string text)
 Display a piece of UTF8 encoded unicode text. More...
 
Element vtext (std::string text)
 Display a piece of unicode text vertically. More...
 
Element separator ()
 Draw a vertical or horizontal separation in between two other elements. More...
 
Element separatorLight ()
 Draw a vertical or horizontal separation in between two other elements, using the LIGHT style. More...
 
Element separatorDashed ()
 Draw a vertical or horizontal separation in between two other elements, using the DASHED style. More...
 
Element separatorHeavy ()
 Draw a vertical or horizontal separation in between two other elements, using the HEAVY style. More...
 
Element separatorDouble ()
 Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style. More...
 
Element separatorEmpty ()
 Draw a vertical or horizontal separation in between two other elements, using the EMPTY style. More...
 
Element separatorStyled (BorderStyle style)
 Draw a vertical or horizontal separation in between two other elements. More...
 
Element separator (Pixel pixel)
 Draw a separator in between two element filled with a given pixel. More...
 
Element separatorCharacter (std::string value)
 Draw a vertical or horizontal separation in between two other elements. More...
 
Element separatorHSelector (float left, float right, Color unselected_color, Color selected_color)
 Draw an horizontal bar, with the area in between left/right colored differently. More...
 
Element separatorVSelector (float up, float down, Color unselected_color, Color selected_color)
 Draw an vertical bar, with the area in between up/downcolored differently. More...
 
Element gauge (float progress)
 Draw a high definition progress bar. More...
 
Element gaugeLeft (float progress)
 Draw a high definition progress bar progressing from right to left. More...
 
Element gaugeRight (float progress)
 Draw a high definition progress bar progressing from left to right. More...
 
Element gaugeUp (float progress)
 Draw a high definition progress bar progressing from bottom to top. More...
 
Element gaugeDown (float progress)
 Draw a high definition progress bar progressing from top to bottom. More...
 
Element gaugeDirection (float progress, Direction direction)
 Draw a high definition progress bar progressing in specified direction. More...
 
Element border (Element child)
 Draw a border around the element. More...
 
Element borderLight (Element child)
 Draw a dashed border around the element. More...
 
Element borderDashed (Element child)
 Draw a light border around the element. More...
 
Element borderHeavy (Element child)
 Draw a heavy border around the element. More...
 
Element borderDouble (Element child)
 Draw a double border around the element. More...
 
Element borderRounded (Element child)
 Draw a rounded border around the element. More...
 
Element borderEmpty (Element child)
 Draw an empty border around the element. More...
 
Decorator borderStyled (BorderStyle style)
 Same as border but with different styles. More...
 
Decorator borderStyled (BorderStyle style, Color foreground_color)
 Same as border but with a foreground color and a different style. More...
 
Decorator borderStyled (Color foreground_color)
 Same as border but with a foreground color. More...
 
Decorator borderWith (const Pixel &pixel)
 Same as border but with a constant Pixel around the element. More...
 
Element window (Element title, Element content)
 Draw window with a title and a border around the element. More...
 
Element spinner (int charset_index, size_t image_index)
 Useful to represent the effect of time and/or events. This display an ASCII art "video". More...
 
Element paragraph (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines. More...
 
Element paragraphAlignLeft (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the left. More...
 
Element paragraphAlignRight (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the right. More...
 
Element paragraphAlignCenter (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the center. More...
 
Element paragraphAlignJustify (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center. More...
 
Element graph (GraphFunction graph_function)
 Draw a graph using a GraphFunction. More...
 
Element emptyElement ()
 
Element canvas (ConstRef< Canvas > canvas)
 Produce an element from a Canvas, or a reference to a Canvas. More...
 
Element canvas (int width, int height, std::function< void(Canvas &)> fn)
 Produce an element drawing a canvas of requested size. More...
 
Element canvas (std::function< void(Canvas &)> fn)
 Produce an element drawing a canvas. More...
 
Element bold (Element child)
 Use a bold font, for elements with more emphasis. More...
 
Element dim (Element child)
 Use a light font, for elements with less emphasis. More...
 
Element inverted (Element child)
 Add a filter that will invert the foreground and the background colors. More...
 
Element underlined (Element child)
 Make the underlined element to be underlined. More...
 
Element underlinedDouble (Element child)
 Apply a underlinedDouble to text. More...
 
Element blink (Element child)
 The text drawn alternates in between visible and hidden. More...
 
Element strikethrough (Element child)
 Apply a strikethrough to text. More...
 
Decorator color (Color c)
 Decorate using a foreground color. More...
 
Decorator bgcolor (Color color)
 Decorate using a background color. More...
 
Decorator color (const LinearGradient &gradient)
 Decorate using a linear-gradient effect on the foreground color. More...
 
Decorator bgcolor (const LinearGradient &gradient)
 Decorate using a linear-gradient effect on the background color. More...
 
Element color (Color color, Element child)
 Set the foreground color of an element. More...
 
Element bgcolor (Color color, Element child)
 Set the background color of an element. More...
 
Element color (const LinearGradient &gradient, Element child)
 Set the foreground color of an element with linear-gradient effect. More...
 
Element bgcolor (const LinearGradient &gradient, Element child)
 Set the background color of an element with linear-gradient effect. More...
 
Decorator focusPosition (int x, int y)
 Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells. More...
 
Decorator focusPositionRelative (float x, float y)
 Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size. More...
 
Element automerge (Element child)
 Enable character to be automatically merged with others nearby. More...
 
Decorator hyperlink (std::string link)
 Decorate using an hyperlink. The link will be opened when the user click on it. This is supported only on a limited set of terminal emulator. List: https://github.com/Alhadis/OSC8-Adoption/. More...
 
Element hyperlink (std::string link, Element child)
 Make the rendered area clickable using a web browser. The link will be opened when the user click on it. This is supported only on a limited set of terminal emulator. List: https://github.com/Alhadis/OSC8-Adoption/. More...
 
Element hbox (Elements children)
 A container displaying elements horizontally one by one. More...
 
Element vbox (Elements children)
 A container displaying elements vertically one by one. More...
 
Element dbox (Elements children_)
 Stack several element on top of each other. More...
 
Element flexbox (Elements, FlexboxConfig config=FlexboxConfig())
 
Element gridbox (std::vector< Elements > lines)
 A container displaying a grid of elements. More...
 
Element hflow (Elements)
 
Element vflow (Elements)
 
Element flex (Element child)
 Make a child element to expand proportionnally to the space left in a container. More...
 
Element flex_grow (Element child)
 Expand if possible. More...
 
Element flex_shrink (Element child)
 Minimize if needed. More...
 
Element xflex (Element child)
 Expand/Minimize if possible/needed on the X axis. More...
 
Element xflex_grow (Element child)
 Expand if possible on the X axis. More...
 
Element xflex_shrink (Element child)
 Minimize if needed on the X axis. More...
 
Element yflex (Element child)
 Expand/Minimize if possible/needed on the Y axis. More...
 
Element yflex_grow (Element child)
 Expand if possible on the Y axis. More...
 
Element yflex_shrink (Element child)
 Minimize if needed on the Y axis. More...
 
Element notflex (Element child)
 Make the element not flexible. More...
 
Element filler ()
 An element that will take expand proportionnally to the space left in a container. More...
 
Decorator size (WidthOrHeight direction, Constraint constraint, int value)
 Apply a constraint on the size of an element. More...
 
Element frame (Element child)
 Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible. More...
 
Element xframe (Element child)
 Same as frame, but only on the x-axis. More...
 
Element yframe (Element child)
 Same as frame, but only on the y-axis. More...
 
Element focus (Element child)
 Set the child to be the one in focus globally. More...
 
Element select (Element child)
 Set the child to be the one selected among its siblings. More...
 
Element focusCursorBlock (Element child)
 Same as focus, but set the cursor shape to be a still block. More...
 
Element focusCursorBlockBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking block. More...
 
Element focusCursorBar (Element child)
 Same as focus, but set the cursor shape to be a still block. More...
 
Element focusCursorBarBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking bar. More...
 
Element focusCursorUnderline (Element child)
 Same as focus, but set the cursor shape to be a still underline. More...
 
Element focusCursorUnderlineBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking underline. More...
 
Element vscroll_indicator (Element child)
 Display a vertical scrollbar to the right. colors. More...
 
Element hscroll_indicator (Element child)
 Display an horizontal scrollbar to the bottom. colors. More...
 
Decorator reflect (Box &box)
 
Element clear_under (Element element)
 Before drawing |child|, clear the pixels below. This is useful in. More...
 
Element hcenter (Element child)
 Center an element horizontally. More...
 
Element vcenter (Element child)
 Center an element vertically. More...
 
Element center (Element child)
 Center an element horizontally and vertically. More...
 
Element align_right (Element child)
 Align an element on the right side. More...
 
Element nothing (Element element)
 A decoration doing absolutely nothing. More...
 
Dimensions Fit (Element &)