#include <string>
return vbox({
text("FTXUI: ユーザーインターフェースを構築するための強力なライブラリ。"),
text("豊富なコンポーネントセットと宣言的なスタイルをお楽しみください。"),
text("最小限の労力で美しく応答性の高いUIを作成します。"),
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) +
" times"),
text("現在選択中: "),
paragraph(selection_content) | vscroll_indicator | frame | border |
separator(),
separator(),
})),
separator(),
separator(),
})),
window(text(
"異なるスタイルのグリッド分割"),
vbox({
hbox({
separator(),
| selectionBackgroundColor(Color::Yellow)
| selectionColor(Color::Black)
| selectionStyleReset,
separator(),
}),
separator(),
hbox({
separator(),
}),
separator(),
}),
})),
quit->Render(),
});
});
screen.Loop(renderer);
}
Element window(Element title, Element content, BorderStyle border)
要素の周囲にタイトルとボーダーを持つウィンドウを描画します。
Unicode文字とそれに関連付けられたスタイル。
std::shared_ptr< Node > Element