examples/dom/gauge_direction.cpp

    //Copyright2022ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<chrono>//foroperator""s,chrono_literals
    #include<ftxui/dom/elements.hpp>//forfiller,operator|,separator,text,border,Element,vbox,vtext,hbox,center,gaugeDown,gaugeLeft,gaugeRight,gaugeUp
    #include<ftxui/screen/screen.hpp>//forScreen
    #include<iostream>//forcout,endl,ostream
    #include<string>//forallocator,operator+,operator<<,string,to_string
    #include<thread>//forsleep_for

    #include"ftxui/dom/node.hpp"//forRender
    #include"ftxui/screen/color.hpp"//forftxui

    intmain(){
    usingnamespaceftxui;
    usingnamespacestd::chrono_literals;

    std::stringreset_position;
    for(floatpercentage=0.0f;percentage<=1.0f;percentage+=0.002f){
    std::stringdata_downloaded=
    std::to_string(int(percentage*5000))+"/5000";

    autogauge_up=//
    hbox({
    vtext("gaugevertical"),
    separator(),
    gaugeUp(percentage),
    })|
    border;

    autogauge_down=//
    hbox({
    vtext("gaugevertical"),
    separator(),
    gaugeDown(percentage),
    })|
    border;

    autogauge_right=//
    vbox({
    text("gaugehorizontal"),
    separator(),
    gaugeRight(percentage),
    })|
    border;

    autogauge_left=//
    vbox({
    text("gaugehorizontal"),
    separator(),
    gaugeLeft(percentage),
    })|
    border;

    autodocument=hbox({
    gauge_up,
    filler(),
    vbox({
    gauge_right,
    filler(),
    text(data_downloaded)|border|center,
    filler(),
    gauge_left,
    }),
    filler(),
    gauge_down,
    });

    autoscreen=Screen(32,16);
    Render(screen,document);
    std::cout<<reset_position;
    screen.Print();
    reset_position=screen.ResetPosition();

    std::this_thread::sleep_for(0.01s);
    }
    std::cout<<std::endl;
    }