FTXUI
6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
strikethrough.cpp
浏览该文件的文档.
1
// 版权所有 2023 Arthur Sonzogni。保留所有权利。
2
// 本源代码的使用受 MIT 许可证的约束,该许可证可在
3
// LICENSE 文件中找到。
4
#include <memory>
// for make_shared
5
#include <utility>
// for move
6
7
#include "
ftxui/dom/elements.hpp
"
// for Element, strikethrough
8
#include "
ftxui/dom/node.hpp
"
// for Node
9
#include "
ftxui/dom/node_decorator.hpp
"
// for NodeDecorator
10
#include "
ftxui/screen/box.hpp
"
// for Box
11
#include "
ftxui/screen/screen.hpp
"
// for Pixel, Screen
12
13
namespace
ftxui
{
14
15
/// @brief 对文本应用删除线。
16
/// @ingroup dom
17
Element
strikethrough
(
Element
child) {
18
class
Impl :
public
NodeDecorator
{
19
public
:
20
using
NodeDecorator::NodeDecorator;
21
22
void
Render(
Screen
& screen)
override
{
23
for
(
int
y = box_.y_min; y <= box_.y_max; ++y) {
24
for
(
int
x = box_.x_min; x <= box_.x_max; ++x) {
25
screen.
PixelAt
(x, y).
strikethrough
=
true
;
26
}
27
}
28
Node::Render(screen);
29
}
30
};
31
32
return
std::make_shared<Impl>(std::move(child));
33
}
34
35
}
// namespace ftxui
box.hpp
ftxui::NodeDecorator
定义
node_decorator.hpp:15
elements.hpp
ftxui::strikethrough
Element strikethrough(Element)
对文本应用删除线。
定义
strikethrough.cpp:17
ftxui::Pixel::strikethrough
bool strikethrough
定义
pixel.hpp:34
ftxui::Image::PixelAt
Pixel & PixelAt(int x, int y)
访问给定位置的单元格 (Pixel)。
定义
image.cpp:42
ftxui::Screen
像素的矩形网格。
定义
screen.hpp:26
ftxui
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
定义
animation.hpp:9
ftxui::Element
std::shared_ptr< Node > Element
定义
elements.hpp:22
node.hpp
node_decorator.hpp
screen.hpp