YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
textarea.cpp
浏览该文件的文档.
1 /*
2  © 2011-2014 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 
41  : Widget(r, b, c), TextState(), TextRenderer(*this),
42  Rotation(Drawing::RDeg0)
43 {}
45  : Widget(r, b, c), TextState(fc), TextRenderer(*this),
46  Rotation(Drawing::RDeg0)
47 {}
48 
49 
51  : Widget(r, b, c), TextRegion(),
52  Rotation(Drawing::RDeg0)
53 {
54  //初始化视图。
55  TextRegion::SetSize(GetWidth(), GetHeight());
56 }
59  : Widget(r, b, c), TextRegion(fc),
60  Rotation(Drawing::RDeg0)
61 {
62  //初始化视图。
63  TextRegion::SetSize(GetWidth(), GetHeight());
64 }
65 
66 void
68 {
69  const auto& g(e.Target);
70  const Rect& r(e.ClipArea);
71 
72  BlitTo(g.GetBufferPtr(), *this, g.GetSize(), r.GetPoint(),
73  r.GetPoint() - e.Location, r.GetSize(), Rotation);
74 }
75 
76 } // namespace UI;
77 
78 } // namespace YSLib;
79 
BufferedTextArea(const Drawing::Rect &={}, HBrush=MakeBlankBrush(), Drawing::Color=Drawing::ColorSpace::Black)
构造:使用指定边界、默认字型缓存、指定背景画刷和指定文字颜色。
Definition: textarea.cpp:50
Drawing::Rotation Rotation
屏幕指向。
Definition: textarea.h:77
void Refresh(PaintEventArgs &&) override
刷新:按指定参数绘制界面并更新状态。
Definition: textarea.cpp:67
部件绘制参数。
Definition: ywgtevt.h:276
sizeof(AlphaType)*GetAreaOf(GetSize())) using CompactPixmap void SetSize(const Size &) override
重新设置缓冲区大小。
字体缓存。
Definition: Font.h:415
文本状态。
Definition: TextBase.h:87
文本渲染器:简单实现。
Definition: TextRenderer.h:361
屏幕标准矩形:表示屏幕矩形区域。
Definition: ygdibase.h:416
std::function< void(PaintEventArgs &&)> HBrush
画刷回调函数。
Definition: YComponent.h:104
Rotation
逆时针旋转角度指示输出指向。
Definition: ygdibase.h:868
TextArea(const Drawing::Rect &={}, HBrush=MakeBlankBrush(), Drawing::Color=Drawing::ColorSpace::Black)
构造:使用指定边界、默认字型缓存、指定背景画刷和指定文字颜色。
Definition: textarea.cpp:40
bounds & r
Definition: ydraw.h:220
c yconstfn g
Definition: ystyle.h:104
颜色。
Definition: Video.h:339
部件。
Definition: ywidget.h:356
YF_API bool BlitTo(BitmapPtr, const CompactPixmapEx &, const Size &, const Point &, const Point &, const Size &, Rotation=RDeg0)
贴图:位图缓冲区向指针指定的缓冲区以贴图算法复制。
Definition: ygdi.cpp:253