4#ifndef FTXUI_DOM_ELEMENTS_HPP
5#define FTXUI_DOM_ELEMENTS_HPP
64 Color unselected_color,
65 Color selected_color);
68 Color unselected_color,
69 Color selected_color);
200#include "ftxui/dom/take_any_args.hpp"
Decorator bgcolor(Color)
使用背景色进行装饰。
Element xflex(Element)
在 X 轴上尽可能地扩展/收缩。
Element gaugeDirection(float progress, Direction direction)
绘制一个向指定方向推进的高清进度条。
Decorator focusPositionRelative(float x, float y)
在 frame 内部使用,这会强制视图滚动到给定位置。位置以请求大小的比例表示。
Element separatorStyled(BorderStyle)
在两个其他元素之间绘制垂直或水平分隔线。
Element xflex_grow(Element)
如果可能,在 X 轴上进行扩展。
Element underlinedDouble(Element)
对文本应用双下划线。
Element clear_under(Element element)
在绘制 |child| 之前,清除下方的像素。这与 dbox 结合使用很有用。
Element separatorEmpty()
使用 EMPTY 样式在两个其他元素之间绘制垂直或水平分隔线。
Element vscroll_indicator(Element)
在右侧显示一个垂直滚动条。 颜色跟随内容。
Element nothing(Element element)
一个什么都不做的装饰器。
Decorator size(WidthOrHeight, Constraint, int value)
对元素大小应用约束。
Direction
Direction 是一个枚举,表示四个基本方向。
Element flex(Element)
使子元素按比例扩展以填充容器中剩余的空间。
Element paragraphAlignRight(const std::string &text)
返回一个在多行上绘制段落并右对齐的元素。
Element bold(Element)
使用粗体字体,用于强调元素。
Element separatorLight()
使用 LIGHT 样式在两个其他元素之间绘制垂直或水平分隔线。
Element spinner(int charset_index, size_t image_index)
用于表示时间或事件的效果。这显示了一个 ASCII 艺术“视频”。
Element yflex(Element)
在 Y 轴上尽可能地扩展/收缩。
Element flex_shrink(Element)
如果需要,进行收缩。
Element underlined(Element)
给定元素加下划线。
Element center(Element)
水平并垂直居中一个元素。
Element inverted(Element)
添加一个过滤器,用于反转前景色和背景色。
Element paragraphAlignCenter(const std::string &text)
返回一个在多行上绘制段落并居中对齐的元素。
Element text(std::wstring text)
显示一段Unicode文本。
Element align_right(Element)
将元素右对齐。
Decorator focusPosition(int x, int y)
在 frame 内部使用,这会强制视图滚动到给定位置。位置以单元格数量表示。
Element yflex_grow(Element)
如果可能,在 Y 轴上进行扩展。
Element hscroll_indicator(Element)
在底部显示一个水平滚动条。 颜色跟随内容。
Element flex_grow(Element)
如果可能,进行扩展。
Element separatorDashed()
使用 DASHED 样式在两个其他元素之间绘制垂直或水平分隔线。
Element notflex(Element)
使元素不可伸缩。
Element strikethrough(Element)
对文本应用删除线。
Element italic(Element)
对文本应用双下划线。
Element dbox(Elements)
将多个元素堆叠在一起。
Element xflex_shrink(Element)
如果需要,在 X 轴上进行收缩。
Element separatorCharacter(std::string)
在两个其他元素之间绘制垂直或水平分隔线。
Element vtext(std::wstring text)
垂直显示一段Unicode文本。
Element focus(Element)
将 child 设置为其同级元素中获得焦点的元素。
Element paragraphAlignLeft(const std::string &text)
返回一个在多行上绘制段落并左对齐的元素。
Element separator()
在两个其他元素之间绘制垂直或水平分隔线。
Element filler()
一个元素,它将按比例扩展以填充容器中剩余的空间。
Element dim(Element)
使用浅色字体,用于不那么重要的元素。
Element automerge(Element child)
启用字符自动与附近的其它字符合并。
Decorator hyperlink(std::string link)
使用超链接进行装饰。 当用户点击时,链接将被打开。 这仅在有限的终端模拟器中受支持。 列表:https://github.com/Alhadis/OSC8-Adoption/
Element blink(Element)
绘制的文本在可见和隐藏之间交替。
Element vcenter(Element)
垂直居中一个元素。
Element separatorDouble()
使用 DOUBLE 样式在两个其他元素之间绘制垂直或水平分隔线。
Element paragraphAlignJustify(const std::string &text)
返回一个在多行上绘制段落并使用两端对齐方式的元素。 居中对齐。
Element separatorHeavy()
使用 HEAVY 样式在两个其他元素之间绘制垂直或水平分隔线。
Decorator color(Color)
使用前景色进行装饰。
Element yflex_shrink(Element)
如果需要,在 Y 轴上进行收缩。
Element hcenter(Element)
水平居中一个元素。
Element vbox(Elements)
垂直一个接一个显示元素的容器。
BorderStyle
BorderStyle 是一个枚举,表示可应用于终端 UI 中元素的不同边框样式。
Canvas 是一个与绘图操作相关的可绘制缓冲区。
FlexboxConfig 是一个配置结构体,定义了弹性盒子容器的布局属性。
FTXUI ftxui::Dimension:: 命名空间
Dimensions Fit(Element &, bool extend_beyond_screen=false)
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
std::function< Element(Element)> Decorator
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
一个容器,用于在行/列中显示元素,并且在填满时能够换行到下一列/行。
Element separatorVSelector(float up, float down, Color unselected_color, Color selected_color)
绘制一个垂直条,上下区域颜色不同。
std::shared_ptr< Node > Element
Element xframe(Element)
与 frame 相同,但仅限于 x 轴。
Element gaugeRight(float progress)
绘制一个从左到右推进的高清进度条。
Element hflow(Elements)
一个容器,用于从左到右在行中显示元素。当填满时,它会在下方开始新的一行。
Decorator selectionStyle(std::function< void(Pixel &)> style)
设置元素选中时的样式。
Element borderEmpty(Element)
Element focusCursorBlock(Element)
Element focusCursorUnderlineBlinking(Element)
Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
绘制一个水平条,左右区域颜色不同。
Element focusCursorBar(Element)
Element hbox(Elements)
一个按水平顺序逐一显示元素的容器。
Element canvas(ConstRef< Canvas >)
从 Canvas 或 Canvas 引用生成元素。
std::vector< Element > Elements
Decorator selectionForegroundColor(Color foreground)
设置元素选中时的前景色。 请注意,此样式是在现有样式之上应用的。
Component operator|(Component component, ComponentDecorator decorator)
Decorator selectionBackgroundColor(Color foreground)
设置元素选中时的背景颜色。 请注意,此样式是在现有样式之上应用的。
Element borderHeavy(Element)
Element gaugeUp(float progress)
绘制一个从下到上推进的高清进度条。
Element focusCursorBlockBlinking(Element)
Element borderRounded(Element)
Element yframe(Element)
与 frame 相同,但仅限于 y 轴。
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Decorator selectionColor(Color foreground)
设置元素选中时的颜色。
Decorator borderStyled(BorderStyle)
Element gaugeLeft(float progress)
绘制一个从右到左推进的高清进度条。
Element select(Element e)
将 child 设置为其同级元素中获得焦点的元素。
Element borderDashed(Element)
Element selectionStyleReset(Element)
重置元素的选中样式。
Element borderDouble(Element)
Decorator reflect(Box &box)
std::function< std::vector< int >(int, int)> GraphFunction
Element gridbox(std::vector< Elements > lines)
一个显示元素网格的容器。
Element focusCursorUnderline(Element)
Decorator borderWith(const Pixel &)
Elements paragraph(std::wstring text)
Element frame(Element)
允许元素显示在“虚拟”区域内。其大小可以 大于其容器。在这种情况下,只显示较小的部分。 视图是可滚动的,以使获得焦点的元素可见。
Component & operator|=(Component &component, ComponentDecorator decorator)
Element gauge(float progress)
绘制一个高清进度条。
Element vflow(Elements)
一个容器,用于从上到下在行中显示元素。当填满时,它会在右侧开始新的一列。
Element graph(GraphFunction)
使用 GraphFunction 绘制图表。
Element borderLight(Element)
Element focusCursorBarBlinking(Element)
Element gaugeDown(float progress)
绘制一个从上到下推进的高清进度条。