FTXUI
6.1.9
C++ functional terminal UI.
Chargement...
Recherche...
Aucune correspondance
vflow.cpp
Aller à la documentation de ce fichier.
1
// Copyright 2020 Arthur Sonzogni. All rights reserved.
2
// L'utilisation de ce code source est régie par la licence MIT que l'on peut trouver dans
3
// le fichier LICENSE.
4
#include <stdio.h>
// for getchar
5
#include <
ftxui/dom/elements.hpp
>
// for operator|, Element, size, text, hcenter, Fit, vflow, window, EQUAL, bold, border, dim, HEIGHT, WIDTH
6
#include <
ftxui/screen/screen.hpp
>
// for Full, Screen
7
#include <string>
// for allocator, char_traits, operator+, to_string, string
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
auto
make_box
= [](
int
dimx,
int
dimy) {
15
std::string title = std::to_string(dimx) +
"x"
+ std::to_string(dimy);
16
return
window(text(title) | hcenter | bold,
17
text(
"content"
) | hcenter | dim) |
18
size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
19
};
20
21
auto
document = vflow({
22
make_box
(7, 7),
23
make_box
(7, 5),
24
make_box
(5, 7),
25
make_box
(10, 4),
26
make_box
(10, 4),
27
make_box
(10, 4),
28
make_box
(10, 4),
29
make_box
(11, 4),
30
make_box
(11, 4),
31
make_box
(11, 4),
32
make_box
(11, 4),
33
make_box
(12, 4),
34
make_box
(12, 5),
35
make_box
(12, 4),
36
make_box
(13, 4),
37
make_box
(13, 3),
38
make_box
(13, 3),
39
make_box
(10, 3),
40
}) |
41
border;
42
43
auto
screen
= Screen::Create(Dimension::Full(), Dimension::Fit(document));
44
Render
(
screen
, document);
45
screen
.Print();
46
getchar();
47
48
return
0;
49
}
color.hpp
screen
auto screen
Definition
composition.cpp:56
elements.hpp
make_box
Element make_box(int x, int y)
Definition
examples/component/focus.cpp:17
Render
void Render(Screen &screen, const Element &element)
Affiche un élément sur un ftxui::Screen.
Definition
node.cpp:83
ftxui
L'espace de noms FTXUI ftxui::
Definition
animation.hpp:10
node.hpp
screen.hpp
main
int main()
Definition
vflow.cpp:12