FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
separator_style.cpp
浏览该文件的文档.
1// 版权所有 2020 Arthur Sonzogni. 保留所有权利。
2// 本源代码的使用受 MIT 许可证的约束,该许可证可在 LICENSE 文件中找到。
3#include <ftxui/screen/screen.hpp> // for Screen
4#include <iostream> // for endl, cout, ostream
5#include <memory> // for allocator
6
7#include "ftxui/dom/elements.hpp" // for text, hbox, separatorDouble, separatorHeavy, separatorLight, vbox, operator|, Element, Fit, borderDouble, borderHeavy, borderLight
8#include "ftxui/dom/node.hpp" // for Render
9#include "ftxui/screen/box.hpp" // for ftxui
10
11int main() {
12 using namespace ftxui;
13
14 auto document = vbox({
15 vbox({
16 text("separatorLight"),
17 separatorLight(),
18 hbox(text("left"), separatorLight(), text("right")),
19 }) | borderLight,
20
21 vbox({
22 text("separatorDashed"),
23 separatorDashed(),
24 hbox(text("left"), separatorDashed(), text("right")),
25 }) | borderDashed,
26
27 vbox({
28 text("separatorHeavy"),
29 separatorHeavy(),
30 hbox(text("left"), separatorHeavy(), text("right")),
31 }) | borderHeavy,
32
33 vbox({
34 text("separatorDouble"),
35 separatorDouble(),
36 hbox(text("left"), separatorDouble(), text("right")),
37 }) | borderDouble,
38 });
39
40 auto screen =
41 Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
42 Render(screen, document);
43 screen.Print();
44 std::cout << std::endl;
45}
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase