FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
elements.cppm
Go to the documentation of this file.
1/// @module ftxui.dom.elements
2/// @brief Module file for the Element classes and functions of the Dom module
3
4module;
5
7
8export module ftxui.dom.elements;
9
10/**
11 * @namespace ftxui
12 * @brief The FTXUI ftxui:: namespace
13 */
14export namespace ftxui {
15 using ftxui::Node;
16 using ftxui::Element;
17 using ftxui::Elements;
18 using ftxui::Decorator;
20
22
23 using ftxui::operator|;
24 using ftxui::operator|=;
25
26 using ftxui::text;
27 using ftxui::vtext;
28 using ftxui::separator;
38 using ftxui::gauge;
39 using ftxui::gaugeLeft;
41 using ftxui::gaugeUp;
42 using ftxui::gaugeDown;
44 using ftxui::border;
53 using ftxui::window;
54 using ftxui::spinner;
55 using ftxui::paragraph;
60 using ftxui::graph;
62 using ftxui::canvas;
63
64 using ftxui::bold;
65 using ftxui::dim;
66 using ftxui::italic;
67 using ftxui::inverted;
70 using ftxui::blink;
72 using ftxui::color;
73 using ftxui::bgcolor;
76 using ftxui::automerge;
77 using ftxui::hyperlink;
83
84 using ftxui::hbox;
85 using ftxui::vbox;
86 using ftxui::dbox;
87 using ftxui::flexbox;
88 using ftxui::gridbox;
89 using ftxui::hflow;
90 using ftxui::vflow;
91
92 using ftxui::flex;
93 using ftxui::flex_grow;
95 using ftxui::xflex;
98 using ftxui::yflex;
101 using ftxui::notflex;
102 using ftxui::filler;
103
105 using ftxui::Constraint;
106 using ftxui::size;
107
108 using ftxui::frame;
109 using ftxui::xframe;
110 using ftxui::yframe;
111 using ftxui::focus;
112 using ftxui::select;
113
120
123 using ftxui::reflect;
124 using ftxui::clear_under;
125
126 using ftxui::hcenter;
127 using ftxui::vcenter;
128 using ftxui::center;
129 using ftxui::align_right;
130 using ftxui::nothing;
131
132 namespace Dimension {
134 }
135}
Node is the base class for all elements in the DOM tree.
Definition node.hpp:37
Decorator bgcolor(Color)
Decorate using a background color.
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
Element borderDouble(Element)
Draw a double border around the element.
Element focusCursorBarBlinking(Element)
Same as focus, but set the cursor shape to be a blinking bar.
Definition frame.cpp:189
Element xflex(Element)
Expand/Minimize if possible/needed on the X axis.
Definition flex.cpp:129
Element gaugeDirection(float progress, Direction direction)
Draw a high definition progress bar progressing in specified direction.
Decorator focusPositionRelative(float x, float y)
Used inside a frame, this force the view to be scrolled toward a a given position....
Element separatorStyled(BorderStyle)
Draw a vertical or horizontal separation in between two other elements.
Element xflex_grow(Element)
Expand if possible on the X axis.
Definition flex.cpp:147
Element underlinedDouble(Element)
Apply a underlinedDouble to text.
Element clear_under(Element element)
Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
Element borderDashed(Element)
Draw a dashed border around the element.
Element separatorEmpty()
Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
Element vscroll_indicator(Element)
Display a vertical scrollbar on the right. Colors follow the content.
Element nothing(Element element)
A decoration doing absolutely nothing.
Definition dom/util.cpp:28
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123
Element paragraphAlignRight(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the right.
Element gaugeRight(float progress)
Draw a high definition progress bar progressing from left to right.
Element focusCursorUnderlineBlinking(Element)
Same as focus, but set the cursor shape to be a blinking underline.
Definition frame.cpp:217
Element bold(Element)
Use a bold font, for elements with more emphasis.
Definition bold.cpp:33
Element separatorLight()
Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
Element spinner(int charset_index, size_t image_index)
Useful to represent the effect of time and/or events. This displays an ASCII art "video".
Element borderRounded(Element)
Draw a rounded border around the element.
Element emptyElement()
Definition dom/util.cpp:140
Element yflex(Element)
Expand/Minimize if possible/needed on the Y axis.
Definition flex.cpp:135
Element flex_shrink(Element)
Minimize if needed.
Definition flex.cpp:159
Element focusCursorBar(Element)
Same as focus, but set the cursor shape to be a still block.
Definition frame.cpp:175
Element focusCursorBlock(Element)
Same as focus, but set the cursor shape to be a still block.
Definition frame.cpp:147
Element underlined(Element)
Underline the given element.
Element center(Element)
Center an element horizontally and vertically.
Element focusCursorUnderline(Element)
Same as focus, but set the cursor shape to be a still underline.
Definition frame.cpp:203
Element borderHeavy(Element)
Draw a heavy border around the element.
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Definition inverted.cpp:34
Element paragraphAlignCenter(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the center.
Element gaugeUp(float progress)
Draw a high definition progress bar progressing from bottom to top.
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
Element align_right(Element)
Align an element on the right side.
Decorator focusPosition(int x, int y)
Used inside a frame, this force the view to be scrolled toward a a given position....
Element yflex_grow(Element)
Expand if possible on the Y axis.
Definition flex.cpp:153
Element hscroll_indicator(Element)
Display a horizontal scrollbar at the bottom. Colors follow the content.
Element flex_grow(Element)
Expand if possible.
Definition flex.cpp:141
Element separatorDashed()
Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
Element notflex(Element)
Make the element not flexible.
Definition flex.cpp:177
Element strikethrough(Element)
Apply a strikethrough to text.
Element italic(Element)
Apply a underlinedDouble to text.
Definition italic.cpp:17
Element dbox(Elements)
Stack several element on top of each other.
Element xflex_shrink(Element)
Minimize if needed on the X axis.
Definition flex.cpp:165
Element gaugeLeft(float progress)
Draw a high definition progress bar progressing from right to left.
Element separatorCharacter(std::string)
Draw a vertical or horizontal separation in between two other elements.
Element vtext(std::wstring text)
Display a piece unicode text vertically.
Definition text.cpp:220
Element borderLight(Element)
Draw a light border around the element.
Element focus(Element)
Set the child to be the one focused among its siblings.
Definition frame.cpp:101
Element paragraphAlignLeft(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the left.
Decorator borderWith(const Pixel &)
Same as border but with a constant Pixel around the element.
Decorator borderStyled(BorderStyle)
Same as border but with different styles.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element filler()
An element that will take expand proportionally to the space left in a container.
Definition flex.cpp:98
Element dim(Element)
Use a light font, for elements with less emphasis.
Definition dim.cpp:33
Element automerge(Element child)
Enable character to be automatically merged with others nearby.
Definition automerge.cpp:17
Decorator hyperlink(std::string link)
Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported onl...
Definition hyperlink.cpp:70
Element blink(Element)
The text drawn alternates in between visible and hidden.
Definition blink.cpp:33
Element vcenter(Element)
Center an element vertically.
Element separatorDouble()
Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
Element focusCursorBlockBlinking(Element)
Same as focus, but set the cursor shape to be a blinking block.
Definition frame.cpp:161
Element gauge(float progress)
Draw a high definition progress bar.
Element paragraphAlignJustify(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned using a justified alignment....
Element border(Element)
Draw a border around the element.
Element separatorHeavy()
Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
Element borderEmpty(Element)
Draw an empty border around the element.
Decorator color(Color)
Decorate using a foreground color.
Element yflex_shrink(Element)
Minimize if needed on the Y axis.
Definition flex.cpp:171
Element hcenter(Element)
Center an element horizontally.
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
BorderStyle
BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
Definition elements.hpp:35
Element gaugeDown(float progress)
Draw a high definition progress bar progressing from top to bottom.
Module file for the Element classes and functions of the Dom module.
Dimensions Fit(Element &, bool extend_beyond_screen=false)
Definition dom/util.cpp:93
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
WidthOrHeight
Definition elements.hpp:161
std::function< Element(Element)> Decorator
Definition elements.hpp:24
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
Definition flexbox.cpp:251
Element separatorVSelector(float up, float down, Color unselected_color, Color selected_color)
Draw an vertical bar, with the area in between up/downcolored differently.
std::shared_ptr< Node > Element
Definition elements.hpp:22
Element xframe(Element)
Same as frame, but only on the x-axis.
Definition frame.cpp:126
Element hflow(Elements)
A container displaying elements in rows from left to right. When filled, it starts on a new row below...
Definition flexbox.cpp:269
Decorator selectionStyle(std::function< void(Pixel &)> style)
Set the style of an element when selected.
Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
Draw a horizontal bar, with the area in between left/right colored differently.
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
Element canvas(ConstRef< Canvas >)
Produce an element from a Canvas, or a reference to a Canvas.
Decorator selectionForegroundColor(Color foreground)
Set the foreground color of an element when selected. Note that the style is applied on top of the ex...
Decorator selectionBackgroundColor(Color foreground)
Set the background color of an element when selected. Note that the style is applied on top of the ex...
std::vector< Element > Elements
Definition elements.hpp:23
Element yframe(Element)
Same as frame, but only on the y-axis.
Definition frame.cpp:134
Decorator selectionColor(Color foreground)
Set the color of an element when selected.
Element select(Element e)
Set the child to be the one focused among its siblings.
Definition frame.cpp:108
Element selectionStyleReset(Element)
Reset the selection style of an element.
Decorator reflect(Box &box)
Definition reflect.cpp:43
std::function< std::vector< int >(int, int)> GraphFunction
Definition elements.hpp:25
Element gridbox(std::vector< Elements > lines)
A container displaying a grid of elements.
Elements paragraph(std::wstring text)
Element frame(Element)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
Definition frame.cpp:118
Element vflow(Elements)
A container displaying elements in rows from top to bottom. When filled, it starts on a new columns o...
Definition flexbox.cpp:289
Element graph(GraphFunction)
Draw a graph using a GraphFunction.