FTXUI 6.1.9 C++ functional terminal UI.

Loading...
Searching...
No Matches
border_colored.cpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
5#include <ftxui/screen/screen.hpp> // for Screen
6#include <iostream> // for endl, cout, ostream
7#include <memory> // for allocator
8
9#include "ftxui/dom/node.hpp" // for Render
10#include "ftxui/screen/color.hpp" // for ftxui
11
12 int main() {
13 using namespace ftxui;
14
15 auto make_boxed = [] {
16 return vbox({
17 text("borderLight") | borderStyled(LIGHT, Color::Red),
18 text("borderDashed") | borderStyled(DASHED, Color::Green),
19 text("borderHeavy") | borderStyled(HEAVY, Color::Blue),
20 text("borderDouble") | borderStyled(DOUBLE, Color::Yellow),
21 text("borderRounded") | borderStyled(ROUNDED, Color::Cyan),
22 });
23 };
24
25 auto document = hbox({
26 make_boxed(),
27 separator() | color(Color::Red),
28 make_boxed(),
29 separator() | color(Color::Red),
30 make_boxed(),
31 }) |
32 borderStyled(ROUNDED, Color::Red);
33
34 auto screen =
35 Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
36 Render(screen, document);
37 screen.Print();
38 std::cout << std::endl;
39}
main
int main()
Definition border_colored.cpp:12
color.hpp
elements.hpp
ftxui
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
node.hpp
screen.hpp