examples/component/focus_cursor.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<ftxui/component/captured_mouse.hpp>//forftxui
    #include<string>//forallocator,operator+,char_traits,string

    #include"ftxui/component/component.hpp"//forRenderer,Vertical
    #include"ftxui/component/screen_interactive.hpp"//forScreenInteractive,Component
    #include"ftxui/dom/elements.hpp"//fortext,Decorator,focus,focusCursorBar,focusCursorBarBlinking,focusCursorBlock,focusCursorBlockBlinking,focusCursorUnderline,focusCursorUnderlineBlinking,hbox,Element

    usingnamespaceftxui;

    ComponentInstance(std::stringlabel,DecoratorfocusCursor){
    returnRenderer([=](boolfocused){
    if(focused){
    returnhbox({
    text(">"+label+""),
    focusCursor(text("")),
    });
    }
    returntext(""+label+"");
    });
    };

    intmain(){
    autoscreen=ScreenInteractive::Fullscreen();
    screen.Loop(Container::Vertical({
    Instance("focus",focus),
    Instance("focusCursorBlock",focusCursorBlock),
    Instance("focusCursorBlockBlinking",focusCursorBlockBlinking),
    Instance("focusCursorBar",focusCursorBar),
    Instance("focusCursorBarBlinking",focusCursorBarBlinking),
    Instance("focusCursorUnderline",focusCursorUnderline),
    Instance("focusCursorUnderlineBlinking",focusCursorUnderlineBlinking),
    }));
    return0;
    }