16const std::vector<std::vector<std::vector<std::string>>> elements = {
18 {
"Replaced by the gauge"},
138 {
"(*----------)"}, {
"(-*---------)"}, {
"(--*--------)"},
139 {
"(---*-------)"}, {
"(----*------)"}, {
"(-----*-----)"},
140 {
"(------*----)"}, {
"(-------*---)"}, {
"(--------*--)"},
141 {
"(---------*-)"}, {
"(----------*)"}, {
"(---------*-)"},
142 {
"(--------*--)"}, {
"(-------*---)"}, {
"(------*----)"},
143 {
"(-----*-----)"}, {
"(----*------)"}, {
"(---*-------)"},
144 {
"(--*--------)"}, {
"(-*---------)"},
258 {
" ",
"_______",
" "},
259 {
" ",
"______/",
" "},
260 {
" _",
"_____/ ",
" "},
261 {
" _ ",
"____/ \\",
" "},
262 {
" _ ",
"___/ \\ ",
" \\"},
263 {
" _ ",
"__/ \\ ",
" \\_"},
264 {
" _ ",
"_/ \\ ",
" \\_/"},
265 {
" _ ",
"/ \\ _",
" \\_/ "},
266 {
"_ ",
" \\ __",
" \\_/ "},
267 {
" ",
"\\ ___",
" \\_/ "},
268 {
" ",
" ___",
"\\_/ "},
269 {
" ",
" _____",
"_/ "},
270 {
" ",
" ______",
"/ "},
271 {
" ",
"_______",
" "},
284 if (charset_index <= 0) {
285 const int progress_size = 40;
286 image_index %= progress_size;
287 if (image_index > progress_size / 2) {
288 image_index = progress_size - image_index;
290 return gauge(
float(image_index) * 0.05F);
292 charset_index %= int(elements.size());
293 image_index %= int(elements[charset_index].
size());
294 std::vector<Element> lines;
295 for (
const auto& it : elements[charset_index][image_index]) {
296 lines.push_back(
text(it));
298 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.