examples/component/dropdown.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<string>//forbasic_string,string,allocator
    #include<vector>//forvector

    #include"ftxui/component/captured_mouse.hpp"//forftxui
    #include"ftxui/component/component.hpp"//forDropdown,Horizontal,Vertical
    #include"ftxui/component/screen_interactive.hpp"//forScreenInteractive

    intmain(){
    usingnamespaceftxui;

    std::vector<std::string>entries={
    "tribute","clearance","ally","bend","electronics",
    "module","era","cultural","sniff","nationalism",
    "negotiation","deliver","figure","east","tribute",
    "clearance","ally","bend","electronics","module",
    "era","cultural","sniff","nationalism","negotiation",
    "deliver","figure","east","tribute","clearance",
    "ally","bend","electronics","module","era",
    "cultural","sniff","nationalism","negotiation","deliver",
    "figure","east",
    };

    intselected_1=0;
    intselected_2=0;
    intselected_3=0;
    intselected_4=0;

    autolayout=Container::Vertical({
    Container::Horizontal({
    Dropdown(&entries,&selected_1),
    Dropdown(&entries,&selected_2),
    }),
    Container::Horizontal({
    Dropdown(&entries,&selected_3),
    Dropdown(&entries,&selected_4),
    }),
    });

    autoscreen=ScreenInteractive::FitComponent();
    screen.Loop(layout);
    }