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