YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
uicontx.cpp
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 2011 - 2013.
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/uicontx.h"
29 #include "YSLib/UI/ygui.h"
30 #include "YSLib/UI/YBrush.h"
31 
33 
35 
37  : Control(r),
38  btnClose(Rect(GetWidth() - 20, 4, 16, 16), 330)
39 {
42  FetchEvent<Paint>(*this).Add(BorderBrush(), BackgroundPriority);
43 }
44 
45 
46 DialogPanel::DialogPanel(const Rect& r)
47  : Panel(r),
48  btnClose(Rect(GetWidth() - 20, 4, 16, 16), 330),
49  btnOK(Rect(GetWidth() - 40, 4, 16, 16), 120)
50 {
51  AddWidgets(*this, btnClose, btnOK),
53  yunseq(
54  FetchEvent<Paint>(*this).Add(BorderBrush(), BackgroundPriority),
55  FetchEvent<Click>(btnOK) += [this](TouchEventArgs&&){
56  Close(*this);
57  },
58  FetchEvent<Paint>(btnOK) += [this](PaintEventArgs&& e){
59  DrawCircle(e.Target, {e.Location.X + 8, e.Location.Y + 8},
62  }
63  );
64 }
65 
67 
68 YSL_END
69