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())
Dibuja un botón. Ejecuta una función cuando se hace clic.
Component Renderer(Component child, std::function< Element()>)
Devuelve un nuevo Component, similar a |child|, pero usando |render| como el evento Component::Render...
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Dibuja una ventana con un título y un borde alrededor del elemento.
Element text(std::string_view text)
Muestra un fragmento de texto Unicode codificado en UTF8.
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
Aplica una restricción al tamaño de un elemento.
Element paragraph(std::string_view the_text)
Devuelve un elemento que dibuja el párrafo en varias líneas.
Element separator()
Dibuja una separación vertical u horizontal entre otros dos elementos.
Element vbox(Elements children)
Un contenedor que muestra elementos verticalmente uno por uno.
El espacio de nombres ftxui:: de FTXUI.
std::shared_ptr< Node > Element
Element hbox(Elements children)
Un contenedor que muestra elementos horizontalmente uno por uno.
Decorator selectionBackgroundColor(Color foreground)
Establece el color de fondo de un elemento cuando está seleccionado. Tenga en cuenta que el estilo se...
Decorator selectionColor(Color foreground)
Establece el color de un elemento cuando está seleccionado.
Element selectionStyleReset(Element child)
Restablece el estilo de selección de un elemento.
Decorator selectionStyle(std::function< void(Cell &)> style)
Establece el estilo de un elemento cuando está seleccionado.