16 text(
"FTXUI:一个用于构建用户界面的强大库。"),
17 text(
"享受丰富的组件集和声明式风格。"),
18 text(
"以最小的努力创建美观且响应迅速的 UI。"),
19 text(
"加入社区,体验 FTXUI 的强大功能。"),
29 int selection_change_counter = 0;
30 std::string selection_content =
"";
31 screen.SelectionChange([&] {
32 selection_change_counter++;
33 selection_content = screen.GetSelection();
39 text(
"选择已更改:" + std::to_string(selection_change_counter) +
42 paragraph(selection_content) | vscroll_indicator | frame | border |
static ButtonOption Animated()
创建一个使用动画颜色的ButtonOption。
static ScreenInteractive TerminalOutput()
Component Button(ButtonOption options)
绘制一个按钮。点击时执行一个函数。
Component Renderer(Component child, std::function< Element()>)
返回一个新组件,类似于 |child|,但使用 |render| 作为 Component::Render() 事件。
virtual void Render(Screen &screen)
在 ftxui::Screen 上显示元素。
Decorator size(WidthOrHeight, Constraint, int value)
对元素大小应用约束。
Element text(std::wstring text)
显示一段Unicode文本。
Element separator()
在两个其他元素之间绘制垂直或水平分隔线。
Element vbox(Elements)
垂直一个接一个显示元素的容器。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
std::shared_ptr< Node > Element
Decorator selectionStyle(std::function< void(Pixel &)> style)
设置元素选中时的样式。
Element hbox(Elements)
一个按水平顺序逐一显示元素的容器。
Decorator selectionBackgroundColor(Color foreground)
设置元素选中时的背景颜色。 请注意,此样式是在现有样式之上应用的。
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Decorator selectionColor(Color foreground)
设置元素选中时的颜色。
Element selectionStyleReset(Element)
重置元素的选中样式。
Elements paragraph(std::wstring text)