20 MenuEntryOption option;
21 option.animated_colors.foreground.enabled =
true;
22 option.animated_colors.background.enabled =
true;
23 option.animated_colors.background.active = c;
24 option.animated_colors.background.inactive = Color::Black;
25 option.animated_colors.foreground.active = Color::White;
26 option.animated_colors.foreground.inactive = c;
31 auto screen = App::TerminalOutput();
34 auto menu = Container::Vertical(
55 hbox(
text(
"selected = "),
text(std::to_string(selected))),
57 menu->Render() |
frame,
62 screen.Loop(renderer);
64 std::cout <<
"Selected element = " << selected << std::endl;
Component Renderer(Component child, std::function< Element()>)
|child| に似た、|render| をComponent::Render()イベントとして 使用する新しいComponentを返します。
Component MenuEntry(ConstStringRef label, MenuEntryOption options={})
特定のメニューエントリ。Container::Verticalに入れることで メニューを形成できます。
Element text(std::string_view text)
UTF8エンコードされたユニコードテキストを表示します。
Element bgcolor(Color color, Element child)
要素の背景色を設定します。
Element vbox(Elements children)
要素を縦に一つずつ表示するコンテナ。
Element hbox(Elements children)
要素を水平方向に1つずつ表示するコンテナ。
Element frame(Element child)
要素を「仮想」領域内に表示できるようにします。そのサイズはコンテナよりも大きくすることができます。 この場合、より小さい部分のみが表示されます。フォーカスされた要素を表示するためにビューはスクロール可能...