15 const std::vector<std::vector<std::vector<std::string>>> elements = {
17 {
"Replaced by the gauge"},
137 {
"(*----------)"}, {
"(-*---------)"}, {
"(--*--------)"},
138 {
"(---*-------)"}, {
"(----*------)"}, {
"(-----*-----)"},
139 {
"(------*----)"}, {
"(-------*---)"}, {
"(--------*--)"},
140 {
"(---------*-)"}, {
"(----------*)"}, {
"(---------*-)"},
141 {
"(--------*--)"}, {
"(-------*---)"}, {
"(------*----)"},
142 {
"(-----*-----)"}, {
"(----*------)"}, {
"(---*-------)"},
143 {
"(--*--------)"}, {
"(-*---------)"},
257 {
" ",
"_______",
" "},
258 {
" ",
"______/",
" "},
259 {
" _",
"_____/ ",
" "},
260 {
" _ ",
"____/ \\",
" "},
261 {
" _ ",
"___/ \\ ",
" \\"},
262 {
" _ ",
"__/ \\ ",
" \\_"},
263 {
" _ ",
"_/ \\ ",
" \\_/"},
264 {
" _ ",
"/ \\ _",
" \\_/ "},
265 {
"_ ",
" \\ __",
" \\_/ "},
266 {
" ",
"\\ ___",
" \\_/ "},
267 {
" ",
" ___",
"\\_/ "},
268 {
" ",
" _____",
"_/ "},
269 {
" ",
" ______",
"/ "},
270 {
" ",
"_______",
" "},
283 if (charset_index <= 0) {
284 const int progress_size = 40;
285 image_index %= progress_size;
286 if (image_index > progress_size / 2) {
287 image_index = progress_size - image_index;
289 return gauge(
float(image_index) * 0.05F);
291 charset_index %= int(elements.size());
292 image_index %= int(elements[charset_index].
size());
293 std::vector<Element> lines;
294 for (
const auto& it : elements[charset_index][image_index]) {
295 lines.push_back(
text(it));
297 return vbox(std::move(lines));
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
std::shared_ptr< Node > Element
Element spinner(int charset_index, size_t image_index)
Useful to represent the effect of time and/or events. This display an ASCII art "video".
Element text(std::wstring text)
Display a piece of unicode text.
Element gauge(float progress)
Draw a high definition progress bar.
Element vbox(Elements)
A container displaying elements vertically one by one.