examples/dom/vflow.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<stdio.h>//forgetchar
    #include<ftxui/dom/elements.hpp>//foroperator|,Element,size,text,hcenter,Fit,vflow,window,EQUAL,bold,border,dim,HEIGHT,WIDTH
    #include<ftxui/screen/screen.hpp>//forFull,Screen
    #include<string>//forallocator,char_traits,operator+,to_string,string

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

    intmain(){
    usingnamespaceftxui;
    automake_box=[](intdimx,intdimy){
    std::stringtitle=std::to_string(dimx)+"x"+std::to_string(dimy);
    returnwindow(text(title)|hcenter|bold,
    text("content")|hcenter|dim)|
    size(WIDTH,EQUAL,dimx)|size(HEIGHT,EQUAL,dimy);
    };

    autodocument=vflow({
    make_box(7,7),
    make_box(7,5),
    make_box(5,7),
    make_box(10,4),
    make_box(10,4),
    make_box(10,4),
    make_box(10,4),
    make_box(11,4),
    make_box(11,4),
    make_box(11,4),
    make_box(11,4),
    make_box(12,4),
    make_box(12,5),
    make_box(12,4),
    make_box(13,4),
    make_box(13,3),
    make_box(13,3),
    make_box(10,3),
    })|
    border;

    autoscreen=Screen::Create(Dimension::Full(),Dimension::Fit(document));
    Render(screen,document);
    screen.Print();
    getchar();

    return0;
    }