17 std::vector<std::string> entries = {
22 int menu_1_selected = 0;
23 int menu_2_selected = 0;
25 bool menu_1_show =
false;
26 bool menu_2_show =
false;
28 auto layout = Container::Vertical({
29 Checkbox(
"Show menu_1", &menu_1_show),
30 Radiobox(&entries, &menu_1_selected) | border |
Maybe(&menu_1_show),
31 Checkbox(
"Show menu_2", &menu_2_show),
32 Radiobox(&entries, &menu_2_selected) | border |
Maybe(&menu_2_show),
36 }) |
Maybe([&] {
return menu_1_selected == 1 && menu_2_selected == 2; }),
static ScreenInteractive TerminalOutput()
ターミナル出力の幅に一致し、描画されるコンポーネントの高さに一致するScreenInteractiveを作成します。
Component Maybe(Component, const bool *show)
コンポーネント|child|を装飾します。|show|がtrueの場合にのみ表示されます。
Component Radiobox(RadioboxOption options)
1つだけ選択できる要素のリスト。
Component Renderer(Component child, std::function< Element()>)
|child|に似ていますが、|render|をComponentRender()イベントとして使用する新しいコンポーネントを返します。
Component Checkbox(CheckboxOption options)
チェック可能な要素を描画します。
Element text(std::wstring text)
ユニコードテキストを表示します。
Decorator color(Color)
前景色を使用して装飾します。