YSTest: Selector.h 源文件

YSTest PreAlpha_b400_20130424 The YSLib Test Project

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

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
Selector.h
浏览该文件的文档.
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 #ifndef YSL_INC_UI_Selector_h_
29 #define YSL_INC_UI_Selector_h_ 1
30
31 #include "button.h"
32 #include "ystyle.h"
33
34 YSL_BEGIN
35
36 YSL_BEGIN_NAMESPACE(UI)
37
38
42 class YF_API CheckBox : public Thumb
43 {
44 public:
50 typedef GValueEventArgs<bool> TickedArgs;
55 DeclDelegate(HTickedEvent, TickedArgs)
56
57 protected:
58 bool bTicked; //选中状态。
59
60 private:
65 DeclEvent(HTickedEvent, Ticked)
66
67 public:
72 explicit
73 CheckBox(const Rect& = {});
74 inline DefDeMoveCtor(CheckBox)
75
76 DefPred(const ynothrow, Ticked, bTicked)
77
82 DefEventGetter(ynothrow, HTickedEvent, Ticked, Ticked)
83
89 void
90 SetTicked(bool);
91
97 void
98 Tick(bool);
99
100 protected:
105 void
106 PaintBox(const Graphics&, const Rect&);
107
108 public:
113 void
114 Refresh(PaintEventArgs&&) override;
115 };
116
117
122 class YF_API CheckButton : public CheckBox, protected MLabel
123 {
124 public:
125 using MLabel::Font;
126 using MLabel::Text;
127
132 explicit
133 CheckButton(const Rect& = {});
134
135 void
136 Refresh(PaintEventArgs&&) override;
137 };
138
139 YSL_END_NAMESPACE(UI)
140
141 YSL_END
142
143 #endif
144