#include <string>
return vbox({
text("FTXUI:一個用於構建使用者介面的強大函式庫。"),
text("享受豐富的組件和宣告式風格。"),
text("以最少的工作量建立美觀且回應迅速的使用者介面。"),
text("加入社群,體驗 FTXUI 的強大功能。"),
});
}
auto screen = ScreenInteractive::TerminalOutput();
auto quit =
Button("Quit", screen.ExitLoopClosure(), ButtonOption::Animated());
int selection_change_counter = 0;
std::string selection_content = "";
screen.SelectionChange([&] {
selection_change_counter++;
selection_content = screen.GetSelection();
});
auto renderer = Renderer(quit, [&] {
return vbox({
text("選取已變更: " + std::to_string(selection_change_counter) +
" 次"),
text("目前選取: "),
paragraph(selection_content) | vscroll_indicator | frame | border |
size(HEIGHT, EQUAL, 10),
window(text("水平分割"), hbox({
separator(),
separator(),
})),
window(text("垂直分割"), vbox({
separator(),
separator(),
})),
window(text("Grid split with different style"),
vbox({
hbox({
separator(),
| selectionBackgroundColor(Color::Yellow)
| selectionColor(Color::Black)
| selectionStyleReset,
separator(),
}),
separator(),
hbox({
separator(),
}),
separator(),
}),
})),
quit->Render(),
});
});
screen.Loop(renderer);
}
std::shared_ptr< Node > Element