3#ifndef FTXUI_COMPONENT_HPP
4#define FTXUI_COMPONENT_HPP
23struct MenuEntryOption;
25template <
class T,
class... Args>
26std::shared_ptr<T>
Make(Args&&... args) {
27 return std::make_shared<T>(std::forward<Args>(args)...);
47 std::function<
void()> on_click,
71 RadioboxOption options = {});
85 ConstRef<int> min = 0,
86 ConstRef<int> max = 100,
87 ConstRef<int> increment = 5);
90 ConstRef<float> min = 0.f,
91 ConstRef<float> max = 100.f,
92 ConstRef<float> increment = 5.f);
95 ConstRef<long> min = 0L,
96 ConstRef<long> max = 100L,
97 ConstRef<long> increment = 5L);
108ComponentDecorator
Renderer(ElementDecorator);
115ComponentDecorator
Maybe(
const bool* show);
116ComponentDecorator
Maybe(std::function<
bool()>);
127 std::function<
void()> on_enter,
128 std::function<
void()> on_leave);
130 std::function<
void(
bool)> on_change);
131ComponentDecorator
Hoverable(
bool* hover);
132ComponentDecorator
Hoverable(std::function<
void()> on_enter,
133 std::function<
void()> on_leave);
134ComponentDecorator
Hoverable(std::function<
void(
bool)> on_change);
アダプター。定数文字列を所有または参照します。便宜上、このクラスは複数の不変文字列を共有表現に変換します。
アダプター。可変オブジェクトを所有または参照します。
アダプター。定数文字列を所有または参照します。便宜上、このクラスは複数の可変文字列を共有表現に変換します。
static CheckboxOption Simple()
標準チェックボックスのオプション。
static ButtonOption Simple()
フォーカス時に反転するButtonOptionを作成します。
static MenuOption Vertical()
垂直メニューの標準オプション。 これは選択可能なアイテムのリストを実装するのに役立ちます。
Component Horizontal(Components children)
コンポーネントのリスト。水平方向に1つずつ描画され、左右の矢印キーまたは'h'/'l'キーを使用して水平方向にナビゲートされます。
Component Maybe(Component, const bool *show)
コンポーネント|child|を装飾します。|show|がtrueの場合にのみ表示されます。
Component ResizableSplitTop(Component main, Component back, int *main_size)
2つのコンポーネント間の垂直分割。マウスで設定可能。
Component Menu(MenuOption options)
テキストのリスト。フォーカスされた要素が選択されます。
Component MenuEntry(MenuEntryOption options)
特定のメニューエントリ。これらはContainer::Verticalに入れてメニューを形成できます。
Component Toggle(ConstStringListRef entries, int *selected)
要素の水平リスト。ユーザーはこれらを操作できます。
Component Radiobox(RadioboxOption options)
1つだけ選択できる要素のリスト。
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked. (ja: ボタンを描画します。クリックされたときに機能を実行します。)
Component Modal(Component main, Component modal, const bool *show_modal)
Component Renderer(Component child, std::function< Element()>)
|child|に似ていますが、|render|をComponentRender()イベントとして使用する新しいコンポーネントを返します。
Component Hoverable(Component component, bool *hover)
コンポーネントをラップします。マウスでホバーされているかどうかを知る機能を提供します。
Component Window(WindowOptions option)
ドラッグ可能/サイズ変更可能なウィンドウ。複数のウィンドウを使用するには、それらを Container::Stacked({...})コンポーネントを使用してスタックする必要があります。
Component Vertical(Components children)
コンポーネントのリスト。垂直方向に1つずつ描画され、上下の矢印キーまたは'j'/'k'キーを使用して垂直方向にナビゲートされます。
Component ResizableSplitRight(Component main, Component back, int *main_size)
2つのコンポーネント間の水平分割。マウスで設定可能。
Component Dropdown(ConstStringListRef entries, int *selected)
ドロップダウンメニュー。
Component Stacked(Components children)
互いの上にスタックされるコンポーネントのリスト。 イベントは、最初のコンポーネントに伝播され、処理されない場合は2番目のコンポーネントに伝播されます。 コンポーネントは与えられた順序とは逆の順序で描画さ...
Component ResizableSplitBottom(Component main, Component back, int *main_size)
2つのコンポーネント間の垂直分割。マウスで設定可能。
Component Checkbox(CheckboxOption options)
チェック可能な要素を描画します。
Component ResizableSplitLeft(Component main, Component back, int *main_size)
2つのコンポーネント間の水平分割。マウスで設定可能。
Component Tab(Components children, int *selector)
コンポーネントのリスト。一度に1つだけ描画され、操作されます。|selector|は選択されたコンポーネントのインデックスを提供します。これはタブを実装するのに便利です。
イベントを表します。キープレスイベント、ターミナルのリサイズなど、さまざまなイベントがあります。
FTXUIのftxui::Container::名前空間
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< Node > Element
std::vector< Component > Components
Component ResizableSplit(ResizableSplitOption options)
2つのコンポーネント間の分割。
Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
折りたたみ可能なコンポーネント。矢印付きのチェックボックスを表示します。アクティブ化されると、子が 表示されます。
Component Input(InputOption options={})
Component operator|(Component component, ElementDecorator decorator)
Component Slider(SliderOption< T > options)
どの方向にも対応するスライダー。
Component & operator|=(Component &component, ComponentDecorator decorator)
std::shared_ptr< ComponentBase > Component
Component CatchEvent(Component child, std::function< bool(Event)>)