17 "FTXUI: A powerful library for building user interfaces.\n"
18 "Enjoy a rich set of components and a declarative style.\n"
19 "Create beautiful and responsive UIs with minimal effort.\n"
20 "Join the community and experience the power of FTXUI.");
24 auto screen = App::TerminalOutput();
27 Button(
"Quit", screen.ExitLoopClosure(), ButtonOption::Animated());
29 int selection_change_counter = 0;
30 std::string selection_content =
"";
31 screen.SelectionChange([&] {
32 selection_change_counter++;
33 selection_content = screen.GetSelection();
39 text(
"Select changed: " + std::to_string(selection_change_counter) +
41 text(
"Currently selected: "),
42 paragraph(selection_content) | vscroll_indicator | frame | border |
58 window(
text(
"Grid split with different style"),
75 pixel.underlined_double =
true;
85 screen.Loop(renderer);
Component Button(ConstStringRef label, std::function< void()> on_click, ButtonOption options=ButtonOption::Simple())
Dessine un bouton. Exécute une fonction lorsqu'il est cliqué.
Component Renderer(Component child, std::function< Element()>)
Retourne un nouveau Component, similaire à |child|, mais utilisant |render| comme événement Component...
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Dessine une fenêtre avec un titre et une bordure autour de l'élément.
Element text(std::string_view text)
Affiche un morceau de texte unicode encodé en UTF8.
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
Applique une contrainte sur la taille d'un élément.
Element paragraph(std::string_view the_text)
Renvoie un élément affichant le paragraphe sur plusieurs lignes.
Element separator()
Dessine une séparation verticale ou horizontale entre deux autres éléments.
Element vbox(Elements children)
Un conteneur affichant les éléments verticalement un par un.
L'espace de noms FTXUI ftxui::
std::shared_ptr< Node > Element
Element hbox(Elements children)
Un conteneur affichant les éléments horizontalement un par un.
Decorator selectionBackgroundColor(Color foreground)
Définit la couleur d'arrière-plan d'un élément lorsqu'il est sélectionné. Notez que le style est appl...
Decorator selectionColor(Color foreground)
Définit la couleur d'un élément lorsqu'il est sélectionné.
Element selectionStyleReset(Element child)
Réinitialise le style de sélection d'un élément.
Decorator selectionStyle(std::function< void(Cell &)> style)
Définit le style d'un élément lorsqu'il est sélectionné.