YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
About.cpp
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 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 "About.h"
29 
30 YSL_BEGIN_NAMESPACE(YReader)
31 
33  : Form({5, 60, 208, 144}, shared_ptr<Image>()),
34  lblTitle({8, 4, 192, 28}), lblVersion({8, 36, 192, 40}),
35  lblCopyright({8, 80, 192, 20}),
36  btnClose({12, 106, 60, 22}),
37  btnExit({84, 106, 60, 22})
38 {
40  lblTitle.Font.SetSize(20),
41  yunseq(
42  lblTitle.Background = nullptr,
43  lblTitle.Text = G_APP_NAME,
44  lblTitle.HorizontalAlignment = TextAlignment::Left,
45  lblTitle.VerticalAlignment = TextAlignment::Down,
46  lblTitle.ForeColor = ColorSpace::Blue,
47  lblVersion.Background = nullptr,
48  lblVersion.AutoWrapLine = true,
49  lblVersion.Text = G_APP_VER + String(" @ " __DATE__ ", " __TIME__),
50  lblVersion.ForeColor = ColorSpace::Green,
51  lblCopyright.Background = nullptr,
52  lblCopyright.Text = String("(C)2009-2013 by ") + G_COMP_NAME,
53  lblCopyright.ForeColor = ColorSpace::Maroon,
54  btnClose.Text = u"关闭",
55  btnExit.Text = u"退出",
56  Background = SolidBrush(Color(248, 120, 120)),
57  btnClose.Background = SolidBrush(Color(176, 184, 192)),
58  FetchEvent<TouchDown>(*this) += [this](TouchEventArgs&& e){
59  Background = SolidBrush(GenerateRandomColor());
60  SetInvalidationOf(*this);
61  if(e.Strategy == RoutedEventArgs::Direct)
62  e.Handled = true;
63  },
64  FetchEvent<TouchMove>(*this) += OnTouchMove_Dragging,
65  FetchEvent<Click>(btnClose) += [this](TouchEventArgs&&){
66  Hide(*this);
67  },
68  FetchEvent<Click>(btnExit) += [](TouchEventArgs&&){
70  }
71  );
72  SetInvalidationOf(*this);
73 }
74 
75 YSL_END_NAMESPACE(YReader)
76