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