examples/component/slider_direction.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<array>//forarray
    #include<cmath>//forsin
    #include<ftxui/component/component_base.hpp>//forComponentBase
    #include<ftxui/component/component_options.hpp>//forSliderOption
    #include<ftxui/dom/direction.hpp>//forDirection,Direction::Up
    #include<ftxui/dom/elements.hpp>//forsize,GREATER_THAN,HEIGHT
    #include<ftxui/util/ref.hpp>//forConstRef,Ref
    #include<memory>//forshared_ptr,__shared_ptr_access

    #include"ftxui/component/captured_mouse.hpp"//forftxui
    #include"ftxui/component/component.hpp"//forHorizontal,Slider,operator|=
    #include"ftxui/component/screen_interactive.hpp"//forScreenInteractive

    usingnamespaceftxui;

    intmain(){
    autoscreen=ScreenInteractive::TerminalOutput();
    std::array<int,30>values;
    for(size_ti=0;i<values.size();++i){
    values[i]=50+20*std::sin(i*0.3);
    }

    autolayout_horizontal=Container::Horizontal({});
    for(auto&value:values){
    //InC++17:
    SliderOption<int>option;
    option.value=&value;
    option.max=100;
    option.increment=5;
    option.direction=Direction::Up;
    layout_horizontal->Add(Slider<int>(option));

    /*InC++20:
    layout_horizontal->Add(Slider<int>({
    .value=&values[i],
    .max=100,
    .increment=5,
    .direction=Direction::Up,
    }));
    */
    }

    layout_horizontal|=size(HEIGHT,GREATER_THAN,20);

    screen.Loop(layout_horizontal);
    }