18 const std::string lorem =
19 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
20 "do eiusmod tempor incididunt ut labore et dolore magna "
21 "aliqua. Ut enim ad minim veniam, quis nostrud exercitation "
22 "ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis "
23 "aute irure dolor in reprehenderit in voluptate velit esse "
24 "cillum dolore eu fugiat nulla pariatur. Excepteur sint "
25 "occaecat cupidatat non proident, sunt in culpa qui officia "
26 "deserunt mollit anim id est laborum.";
28 text(lorem.substr(0, -1)),
text(lorem.substr(5, -1)),
text(
""),
29 text(lorem.substr(10, -1)),
text(lorem.substr(15, -1)),
text(
""),
30 text(lorem.substr(20, -1)),
text(lorem.substr(25, -1)),
text(
""),
31 text(lorem.substr(30, -1)),
text(lorem.substr(35, -1)),
text(
""),
32 text(lorem.substr(40, -1)),
text(lorem.substr(45, -1)),
text(
""),
33 text(lorem.substr(50, -1)),
text(lorem.substr(55, -1)),
text(
""),
34 text(lorem.substr(60, -1)),
text(lorem.substr(65, -1)),
text(
""),
35 text(lorem.substr(70, -1)),
text(lorem.substr(75, -1)),
text(
""),
36 text(lorem.substr(80, -1)),
text(lorem.substr(85, -1)),
text(
""),
37 text(lorem.substr(90, -1)),
text(lorem.substr(95, -1)),
text(
""),
38 text(lorem.substr(100, -1)),
text(lorem.substr(105, -1)),
text(
""),
39 text(lorem.substr(110, -1)),
text(lorem.substr(115, -1)),
text(
""),
40 text(lorem.substr(120, -1)),
text(lorem.substr(125, -1)),
text(
""),
41 text(lorem.substr(130, -1)),
text(lorem.substr(135, -1)),
text(
""),
42 text(lorem.substr(140, -1)),
46 auto scrollable_content =
Renderer(content, [&, content] {
52 option_x.
value = &scroll_x;
55 option_x.increment = 0.1f;
59 auto scrollbar_x =
Slider(option_x);
62 option_y.
value = &scroll_y;
69 auto scrollbar_y =
Slider(option_y);
71 Add(Container::Vertical({
76 Container::Horizontal({
89 .title =
"First window",
103 auto window_container = Container::Stacked({
109 screen.Loop(window_container);
void Add(Component children)
子を追加します。 @param child 添付する子。
static ScreenInteractive Fullscreen()
ftxui::Elementとして自身のレンダリングを実装します。ftxui::Eventに応答してキーボードナビゲーションを実装します。
Component Horizontal(Components children)
コンポーネントのリスト。水平方向に1つずつ描画され、左右の矢印キーまたは'h'/'l'キーを使用して水平方向にナビゲートされます。
Component Renderer(Component child, std::function< Element()>)
|child|に似ていますが、|render|をComponentRender()イベントとして使用する新しいコンポーネントを返します。
Component Window(WindowOptions option)
ドラッグ可能/サイズ変更可能なウィンドウ。複数のウィンドウを使用するには、それらを Container::Stacked({...})コンポーネントを使用してスタックする必要があります。
Decorator focusPositionRelative(float x, float y)
frame内で使用され、ビューを特定の位置にスクロールさせます。位置は要求されたサイズの割合で表されます。
Element flex(Element)
子要素をコンテナに残されたスペースに比例して拡大させます。
Element text(std::wstring text)
ユニコードテキストを表示します。
Element vbox(Elements)
要素を縦に一つずつ表示するコンテナ。
std::shared_ptr< T > Make(Args &&... args)
Component Slider(SliderOption< T > options)
どの方向にも対応するスライダー。
std::shared_ptr< ComponentBase > Component