#include <chrono>
#include <iostream>
#include <string>
#include <thread>
int main() {
using namespace std::chrono_literals;
std::string reset_position;
for (float percentage = 0.0f; percentage <= 1.0f; percentage += 0.002f) {
std::string data_downloaded =
auto gauge_up =
}) |
auto gauge_down =
}) |
auto gauge_right =
text(
"gauge horizontal"),
}) |
auto gauge_left =
text(
"gauge horizontal"),
}) |
gauge_up,
gauge_right,
gauge_left,
}),
gauge_down,
});
auto screen = Screen(32, 16);
std::cout << reset_position;
screen.Print();
reset_position = screen.ResetPosition();
std::this_thread::sleep_for(0.01s);
}
std::cout << std::endl;
}
Element gaugeRight(float progress)
Draw a high definition progress bar progressing from left to right.
Element hbox(Elements)
A container displaying elements horizontally one by one.
Element center(Element)
Center an element horizontally and vertically.
Element gaugeUp(float progress)
Draw a high definition progress bar progressing from bottom to top.
std::string to_string(const std::wstring &s)
Convert a UTF8 std::string into a std::wstring.
Element text(std::wstring text)
Display a piece of unicode text.
Element gaugeLeft(float progress)
Draw a high definition progress bar progressing from right to left.
Element vtext(std::wstring text)
Display a piece unicode text vertically.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element filler()
An element that will take expand proportionally to the space left in a container.
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Element border(Element)
Draw a border around the element.
Element vbox(Elements)
A container displaying elements vertically one by one.
Element gaugeDown(float progress)
Draw a high definition progress bar progressing from top to bottom.