FTXUI
6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
examples/component/checkbox.cpp
浏览该文件的文档.
1
// 版权所有 2021 Arthur Sonzogni。保留所有权利。
2
// 本源代码的使用受 MIT 许可协议的约束,该协议可在 LICENSE 文件中找到。
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
14
using namespace
ftxui
;
15
16
int
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
}
captured_mouse.hpp
component.hpp
component_base.hpp
elements.hpp
main
int main()
定义
examples/component/checkbox.cpp:16
ftxui::ScreenInteractive::FitComponent
static ScreenInteractive FitComponent()
创建一个 ScreenInteractive,其宽度和高度与正在绘制的组件匹配。
定义
screen_interactive.cpp:344
ftxui::Checkbox
Component Checkbox(CheckboxOption options)
绘制可勾选元素。
定义
src/ftxui/component/checkbox.cpp:108
ftxui
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
定义
animation.hpp:9
screen_interactive.hpp