FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
examples/component/checkbox.cpp
Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
2// このソースコードの使用は、LICENSEファイルにあるMITライセンスに準拠しています。
3#include <array> // for array
4#include <iostream>
5#include <memory> // for shared_ptr, __shared_ptr_access
6#include <string> // for operator+, to_string
7
8#include "ftxui/component/captured_mouse.hpp" // for ftxui
9#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
10#include "ftxui/component/component_base.hpp" // for ComponentBase
11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
12#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
13
14using namespace ftxui;
15
16int main() {
17 bool download = false;
18 bool upload = false;
19 bool ping = false;
20
21 auto container = Container::Vertical({
22 Checkbox("Download", &download),
23 Checkbox("Upload", &upload),
24 Checkbox("Ping", &ping),
25 });
26
27 auto screen = ScreenInteractive::FitComponent();
28 screen.Loop(container);
29
30 std::cout << "---" << std::endl;
31 std::cout << "Download: " << download << std::endl;
32 std::cout << "Upload: " << upload << std::endl;
33 std::cout << "Ping: " << ping << std::endl;
34 std::cout << "---" << std::endl;
35
36 return 0;
37}
static ScreenInteractive FitComponent()
描画されるコンポーネントの幅と高さに一致するScreenInteractiveを作成します。
Component Checkbox(CheckboxOption options)
チェック可能な要素を描画します。
FTXUI ftxui:: 名前空間
Definition animation.hpp:9