4#ifndef FTXUI_COMPONENT_HPP
5#define FTXUI_COMPONENT_HPP
25struct MenuEntryOption;
27template <
class T,
class... Args>
28std::shared_ptr<T>
Make(Args&&... args) {
29 return std::make_shared<T>(std::forward<Args>(args)...);
57 std::function<
void()> on_click,
58 ButtonOption options = ButtonOption::Simple());
64 CheckboxOption options = CheckboxOption::Simple());
71 StringRef placeholder,
72 InputOption options = {});
78 MenuOption options = MenuOption::Vertical());
87 RadioboxOption options = {});
107 Slider(SliderOption<uint16_t>);
109 Slider(SliderOption<uint32_t>);
111 Slider(SliderOption<uint64_t>);
120 ConstRef<int> min = 0,
121 ConstRef<int> max = 100,
122 ConstRef<int> increment = 5);
126 ConstRef<float> min = 0.f,
127 ConstRef<float> max = 100.f,
128 ConstRef<float> increment = 5.f);
132 ConstRef<long> min = 0L,
133 ConstRef<long> max = 100L,
134 ConstRef<long> increment = 5L);
170Component Collapsible(ConstStringRef label,
178 std::function<
void()> on_enter,
179 std::function<
void()> on_leave);
182 std::function<
void(
bool)> on_change);
186 std::function<
void()> on_leave);
アダプター。可変オブジェクトを所有または参照します。
#define FTXUI_EXPORT(component)
Component Button(ConstStringRef label, std::function< void()> on_click, ButtonOption options=ButtonOption::Simple())
クリックすると関数を実行するボタンを描画します。
Component ResizableSplitTop(Component main, Component back, int *main_size)
マウスで設定可能な、2つのコンポーネント間の垂直分割。
Component Horizontal(Components children, int *selector)
水平方向に左右矢印キーまたは 'h'/'l' キーで操作される、1つずつ 水平に描画されるコンポーネントのリスト。
Component Toggle(ConstStringListRef entries, int *selected)
要素の水平リスト。ユーザーはこれらを操作できます。
Component Renderer(Component child, std::function< Element()>)
|child| に似た、|render| をComponent::Render()イベントとして 使用する新しいComponentを返します。
Component Checkbox(ConstStringRef label, bool *checked, CheckboxOption options=CheckboxOption::Simple())
チェック可能な要素を描画します。
Component Vertical(Components children)
コンポーネントのリスト。垂直方向に1つずつ描画され、上下の矢印キーまたは'j'/'k'キーを使用して垂直方向にナビゲートされます。
Component ResizableSplitRight(Component main, Component back, int *main_size)
マウスで設定可能な、2つのコンポーネント間の水平分割。
Component Input(StringRef content, InputOption options={})
テキストを編集するための入力ボックス。
Component Dropdown(ConstStringListRef entries, int *selected)
ドロップダウンメニュー。
Component Stacked(Components children)
互いに重ねて配置されるコンポーネントのリスト。 イベントは最初のコンポーネントに伝播され、処理されなければ次に、 というように伝播していきます。 コンポーネントは、与えられた順序の逆順で描画されます。 ...
Component Radiobox(ConstStringListRef entries, int *selected_, RadioboxOption options={})
一つだけ選択できる要素のリスト。
Component ResizableSplitBottom(Component main, Component back, int *main_size)
マウスで設定可能な、2つのコンポーネント間の垂直分割。
Component Menu(ConstStringListRef entries, int *selected_, MenuOption options=MenuOption::Vertical())
テキストのリスト。フォーカスされた要素が選択されます。
Component ResizableSplitLeft(Component main, Component back, int *main_size)
マウスで設定可能な、2つのコンポーネント間の水平分割。
Component Tab(Components children, int *selector)
一度に1つだけ描画され、操作されるコンポーネントのリスト。 |selector| は選択されたコンポーネントのインデックスを示します。これは タブを実装するのに便利です。
Component MenuEntry(ConstStringRef label, MenuEntryOption options={})
特定のメニューエントリ。Container::Verticalに入れることで メニューを形成できます。
FTXUIのftxui::Container::名前空間
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< Node > Element
std::function< Element(Element)> ElementDecorator
std::vector< Component > Components
Component ResizableSplit(ResizableSplitOption options)
2つのコンポーネント間の分割。
Component operator|(Component component, ComponentDecorator decorator)
Component Slider(SliderOption< T > options)
任意の方向のスライダー。
Component & operator|=(Component &component, ComponentDecorator decorator)
std::function< Component(Component)> ComponentDecorator
std::shared_ptr< ComponentBase > Component