YSTest: TextArea.cpp 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

TextArea.cpp
浏览该文件的文档.
1 /*
2 © 2011-2015 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #include "YSLib/UI/YModules.h"
29 #include YFM_YSLib_UI_TextArea
30 #include YFM_YSLib_UI_YWidgetEvent
31
32 namespace YSLib
33 {
34
35 using namespace Drawing;
36
37 namespace UI
38 {
39
40 TextArea::TextArea(const Rect& r, HBrush b, Drawing::Color c)
41 : Widget(r, b), TextState(), TextRenderer(*this),
42 Rotation(Drawing::RDeg0)
43 {
44 Color = c;
45 }
46 TextArea::TextArea(const Rect& r, FontCache& fc, HBrush b, Drawing::Color c)
47 : Widget(r, b), TextState(fc), TextRenderer(*this),
48 Rotation(Drawing::RDeg0)
49 {
50 Color = c;
51 }
52 ImplDeDtor(TextArea)
53
54
55 BufferedTextArea::BufferedTextArea(const Rect& r, HBrush b, Drawing::Color c)
56 : Widget(r, b), TextRegion(),
57 Rotation(Drawing::RDeg0)
58 {
59 Color = c,
60 TextRegion::SetSize(GetWidth(), GetHeight());
61 }
62 BufferedTextArea::BufferedTextArea(const Rect& r, FontCache& fc, HBrush b,
63 Drawing::Color c)
64 : Widget(r, b), TextRegion(fc),
65 Rotation(Drawing::RDeg0)
66 {
67 Color = c,
68 TextRegion::SetSize(GetWidth(), GetHeight());
69 }
70
71 void
72 BufferedTextArea::Refresh(PaintEventArgs&& e)
73 {
74 const auto& g(e.Target);
75 const Rect& bounds(e.ClipArea);
76
77 BlitTo(g.GetBufferPtr(), *this, g.GetSize(), bounds.GetPoint(),
78 bounds.GetPoint() - e.Location, bounds.GetSize(), Rotation);
79 }
80
81 } // namespace UI;
82
83 } // namespace YSLib;
84
YSLib::UI::fc
fc
Definition: Console.h:93
YSLib::Drawing::BlitTo
bool BlitTo(BitmapPtr dst, const CompactPixmapEx &buf, const Size &ds, const Point &dp, const Point &sp, const Size &sc, Rotation rot)
Definition: YGDI.cpp:238
YSLib::UI::BufferedTextArea
缓冲文本区域。
Definition: TextArea.h:79
YSLib::Drawing::Rotation
Rotation
逆时针旋转角度指示输出指向。
Definition: YGDIBase.h:895
YSLib::UI::BufferedTextArea::Rotation
Drawing::Rotation Rotation
屏幕指向。
Definition: TextArea.h:82
YSLib::Drawing::FontCache
字体缓存。
Definition: Font.h:460
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45
platform::Color
颜色。
Definition: Video.h:451
YSLib::Drawing::bounds
The boundary is out of the const Rect & bounds
Definition: YDraw.h:127
YSLib::Drawing::TextRenderer
文本渲染器：简单实现。
Definition: TextRenderer.h:398
YSLib::UI::BufferedTextArea::BufferedTextArea
BufferedTextArea(const Drawing::Rect &={}, HBrush=MakeBlankBrush(), Drawing::Color=Drawing::ColorSpace::Black)
构造：使用指定边界、背景画刷、文本颜色和默认字型缓存。
CHRLib::c
c
Definition: CharacterProcessing.h:81
YSLib::UI::BufferedTextArea::Refresh
void Refresh(PaintEventArgs &&) override
刷新：按指定参数绘制界面并更新状态。
Definition: TextArea.cpp:72
YSLib::UI::ImplDeDtor
ImplDeDtor(Thumb) void DecorateAsCloseButton(Thumb &tmb)
Definition: Button.cpp:125
YSLib::UI::HBrush
std::function< void(PaintEventArgs &&)> HBrush
画刷回调函数。
Definition: YComponent.h:81
YSLib::Drawing::c
The boundary is out of the const Graphics const Rect const Point const Point Color c const Rect const Rect Color c
Definition: YDraw.h:174
YSLib::Drawing::GetHeight
tr GetHeight())) inline PDefH(void
按字体高度和行距调整文本区域的底边距。
YSLib::Drawing::Rect
屏幕标准矩形：表示屏幕矩形区域。
Definition: YGDIBase.h:540
YSLib::Drawing::r
The boundary is out of the const Graphics const Rect const Point const Point Color c const Rect const Rect & r
Definition: YDraw.h:174
Drawing
UI
YSLib::Drawing::TextRegion
文本区域。
Definition: TextRenderer.h:490
YSLib::UI::e
void e
Definition: YWidget.h:352
YModules.h
YSLib::UI::Widget
部件。
Definition: YWidget.h:369
YSLib::UI::TextArea::TextArea
TextArea(const Drawing::Rect &={}, HBrush=MakeBlankBrush(), Drawing::Color=Drawing::ColorSpace::Black)
构造：使用指定边界、背景画刷、文本颜色和默认字型缓存。
Definition: TextArea.cpp:40
YSLib::UI::PaintEventArgs
部件绘制参数。
Definition: YWidgetEvent.h:323
YSLib::Drawing::RDeg0
Definition: YGDIBase.h:897
YSLib::UI::TextArea
文本区域。
Definition: TextArea.h:45
YSLib::Drawing::TextState
文本状态。
Definition: TextBase.h:86
YSLib::Drawing::g
The boundary is out of the const Graphics & g
Definition: YDraw.h:161