YSTest: YWidgetEvent.cpp 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

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

- 文件列表
- 文件成员

YWidgetEvent.cpp
浏览该文件的文档.
1 /*
2 © 2010-2016 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_YWidgetEvent
30 #include YFM_YSLib_UI_YWidget
31
32 namespace YSLib
33 {
34
35 namespace UI
36 {
37
38 ImplDeDtor(UIEventArgs)
39
40
41 ImplDeDtor(RoutedEventArgs)
42
43
44 InputEventArgs::InputEventArgs(IWidget& wgt, const KeyInput& k,
45 RoutingStrategy s)
46 : RoutedEventArgs(wgt, s), Keys(k)
47 {}
48 ImplDeDtor(InputEventArgs)
49
50
51 KeyEventArgs::KeyEventArgs(IWidget& wgt, const InputType& k, RoutingStrategy s)
52 : InputEventArgs(wgt, k, s)
53 {}
54 ImplDeDtor(KeyEventArgs)
55
56
57 CursorEventArgs::CursorEventArgs(IWidget& wgt, const KeyInput& k,
58 const InputType& pt, RoutingStrategy s)
59 : InputEventArgs(wgt, k, s), Position(pt)
60 {}
61 ImplDeDtor(CursorEventArgs)
62
63
64 CursorWheelEventArgs::CursorWheelEventArgs(IWidget& wgt, WheelDelta d,
65 const KeyInput& k, const InputType& pt, RoutingStrategy s)
66 : CursorEventArgs(wgt, k, pt, s), delta(d)
67 {}
68 ImplDeDtor(CursorWheelEventArgs)
69
70
71 TextInputEventArgs::TextInputEventArgs(IWidget& wgt, String str,
72 const KeyInput& k, RoutingStrategy s)
73 : InputEventArgs(wgt, k, s), Text(std::move(str))
74 {}
75 TextInputEventArgs::TextInputEventArgs(InputEventArgs e, String str)
76 : InputEventArgs(std::move(e)), Text(std::move(str))
77 {}
78 ImplDeDtor(TextInputEventArgs)
79
80
81 PaintEventArgs::PaintEventArgs(IWidget& wgt)
82 : UIEventArgs(wgt), PaintContext()
83 {}
84 PaintEventArgs::PaintEventArgs(IWidget& wgt, const PaintContext& pc)
85 : UIEventArgs(wgt), PaintContext(pc)
86 {}
87 PaintEventArgs::PaintEventArgs(IWidget& wgt, const Drawing::Graphics& g,
88 const Drawing::Point& pt, const Drawing::Rect& r)
89 : UIEventArgs(wgt), PaintContext{g, pt, r}
90 {}
91 ImplDeDtor(PaintEventArgs)
92
93
94 ImplDeDtor(BadEvent)
95
96
97 ImplDeDtor(UIEventSignal)
98
99
100 ImplDeDtor(AController)
101
102
103 WidgetController::WidgetController(bool b)
104 : AController(b),
105 Paint()
106 {}
107
108 EventMapping::ItemType&
109 WidgetController::GetItem(VisualEvent id) const
110 {
111 if(id == UI::Paint)
112 return Paint;
113 throw BadEvent();
114 }
115
116
117 EventMapping::ItemType&
118 GetEvent(EventMapping::MapType& m, VisualEvent id,
119 EventMapping::MappedType(&f)())
120 {
121 return ystdex::search_map([&](EventMapping::MapType::const_iterator i){
122 return m.emplace_hint(i, EventMapping::PairType(id, f()));
123 }, m, id).first->second;
124 }
125
126 } // namespace UI;
127
128 } // namespace YSLib;
129
YSLib::UI::BadEvent
错误或不存在的部件事件异常。
Definition: YWidgetEvent.h:499
YSLib::UI::CursorWheelEventArgs
滚轮事件参数。
Definition: YWidgetEvent.h:250
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45
YSLib::UI::WidgetController::Paint
GEventWrapper< GEvent< void(PaintEventArgs &&)>, UIEventArgs && > Paint
Definition: YWidgetEvent.h:696
YSLib::UI::EventMapping::ItemType
GIHEvent< UIEventArgs && > ItemType
Definition: YWidgetEvent.h:483
CHRLib::d
_tDst * d
Definition: CharacterProcessing.h:139
YSLib::Text::String
YSLib 标准字符串（使用 UCS-2 作为内部编码）。
Definition: YString.h:46
YSLib::UI::UIEventArgs
用户界面事件参数基类。
Definition: YWidgetEvent.h:59
YSLib::UI::ImplDeDtor
ImplDeDtor(Thumb) void DecorateAsCloseButton(Thumb &tmb)
Definition: Button.cpp:125
YSLib::UI::PaintEventArgs::PaintEventArgs
PaintEventArgs(IWidget &)
std
Definition: memory.hpp:1100
YSLib::UI::AController
抽象控制器。
Definition: YWidgetEvent.h:539
YSLib::UI::wgt
IWidget & wgt
Definition: YControl.h:112
YSLib::UI::CursorEventArgs
指针设备输入事件参数类。
Definition: YWidgetEvent.h:210
YSLib::Drawing::Rect
屏幕标准矩形：表示屏幕矩形区域。
Definition: YGDIBase.h:540
YSLib::Text::str
const char const char * str
Definition: TextFile.h:77
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
YSLib::UI::EventMapping::MapType
map< VisualEvent, MappedType > MapType
映射表类型。
Definition: YWidgetEvent.h:485
UI
platform::KeyInput
std::bitset< KeyBitsetWidth > KeyInput
按键并行位宽。
Definition: Keys.h:67
YSLib::i
return i
Definition: YCoreUtilities.h:176
YSLib::UI::TextInputEventArgs
文本输入事件参数。
Definition: YWidgetEvent.h:274
YSLib::UI::RoutedEventArgs
路由事件参数基类。
Definition: YWidgetEvent.h:98
YSLib::UI::e
void e
Definition: YWidget.h:352
ystdex::search_map
std::pair< typename _tAssocCon::const_iterator, bool > search_map(const _tAssocCon &con, const _tKey &k)
按指定键搜索指定关联容器。
Definition: container.hpp:1082
YSLib::UI::UIEventSignal
用户事件信号：表示携带用户事件的消息处理中断的异常。
Definition: YWidgetEvent.h:520
YModules.h
Text
YSLib::UI::WidgetController::GetItem
EventMapping::ItemType & GetItem(VisualEvent) const ImplI(AController)
Definition: YWidgetEvent.cpp:109
YSLib::UI::TextInputEventArgs::TextInputEventArgs
TextInputEventArgs(IWidget &, String, const KeyInput &={}, RoutingStrategy=Direct)
YSLib::UI::PaintEventArgs
部件绘制参数。
Definition: YWidgetEvent.h:323
YSLib::UI::VisualEvent
VisualEvent
标准控件事件空间。
Definition: YWidgetEvent.h:370
YSLib::UI::GetEvent
YF_API EventMapping::ItemType & GetEvent(EventMapping::MapType &, VisualEvent, EventMapping::MappedType(&)())
在事件映射表中取指定 id 对应的事件。
YSLib::IO::f
const string &path const String &path _func f
Definition: YSLib/Service/FileSystem.h:430
YSLib::Drawing::GGraphics
二维图形接口上下文模板。
Definition: YGraphics.h:62
YSLib::Drawing::g
The boundary is out of the const Graphics & g
Definition: YDraw.h:161
YSLib::UI::EventMapping::PairType
pair< VisualEvent, MappedType > PairType
Definition: YWidgetEvent.h:484
YSLib::UI::InputEventArgs
输入事件参数类。
Definition: YWidgetEvent.h:133
YSLib::UI::Paint
界面绘制。
Definition: YWidgetEvent.h:416
CHRLib::s
_tDst const _tSrc * s
Definition: CharacterProcessing.h:140
YSLib::UI::WidgetController
部件控制器。
Definition: YWidgetEvent.h:692
YSLib::UI::KeyEventArgs
按键输入事件参数类。
Definition: YWidgetEvent.h:186
YSLib::UI::WheelDelta
ptrdiff_t WheelDelta
滚轮度量：以角度计量的转动滚轮的幅度。
Definition: YWidgetEvent.h:243
YSLib::GEventPointerWrapper
事件项类型。
Definition: YEvent.hpp:934
YSLib::Drawing::GBinaryGroup< SPos >