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())
クリックすると関数を実行するボタンを描画します。
Component Renderer(Component child, std::function< Element()>)
|child| に似た、|render| をComponent::Render()イベントとして 使用する新しいComponentを返します。
Element window(Element title, Element content, BorderStyle border=ROUNDED)
要素の周囲にタイトルとボーダーを持つウィンドウを描画します。
Element text(std::string_view text)
UTF8エンコードされたユニコードテキストを表示します。
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
要素のサイズに制約を適用する。
Element paragraph(std::string_view the_text)
段落を複数行で描画する要素を返します。
Element vbox(Elements children)
要素を縦に一つずつ表示するコンテナ。
std::shared_ptr< Node > Element
Element hbox(Elements children)
要素を水平方向に1つずつ表示するコンテナ。
Decorator selectionBackgroundColor(Color foreground)
要素が選択されたときの背景色を設定します。 スタイルは既存のスタイルに重ねて適用されることに注意してください。
Decorator selectionColor(Color foreground)
要素が選択されたときの色を設定します。
Element selectionStyleReset(Element child)
要素の選択スタイルをリセットします。
Decorator selectionStyle(std::function< void(Cell &)> style)
要素が選択されたときのスタイルを設定します。