YSTest: Button.h 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

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

- 文件列表
- 文件成员

Button.h
浏览该文件的文档.
1 /*
2 © 2010-2015 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 #ifndef YSL_INC_UI_Button_h_
29 #define YSL_INC_UI_Button_h_ 1
30
31 #include "YModules.h"
32 #include YFM_YSLib_UI_YControl
33 #include YFM_YSLib_UI_Label
34 #include YFM_YSLib_UI_YStyle
35
36 namespace YSLib
37 {
38
39 namespace UI
40 {
41
46 class YF_API Thumb : public Control
47 {
48 public:
53 enum StyleItem : Styles::StyleItem
54 {
55 ThumbBackground,
56 EndStyle
57 };
58
63 Color ForeColor{Drawing::ColorSpace::Black};
64
65 protected:
70 CursorState csCurrent;
71
72 private:
74 Drawing::Hue hue = 180;
75
76 public:
81 explicit
82 Thumb(const Rect& = {}, Drawing::Hue = 180);
83
84 protected:
89 explicit
90 Thumb(const Rect&, ystdex::raw_tag);
91
92 public:
93 DefDeMoveCtor(Thumb)
98 ~Thumb() override;
99
104 DefPred(const ynothrow, Pressed, csCurrent == CursorState::Pressed)
105
106
107 DefGetter(const ynothrow, CursorState, CursorState, csCurrent)
109 DefGetter(const ynothrow, Hue, Hue, hue)
110 };
111
119 YF_API void
120 DecorateAsCloseButton(Thumb&);
121
122
127 class YF_API Button : public Thumb, protected MLabel
128 {
129 public:
131 using MLabel::ForeColor;
132 using MLabel::Font;
133 using MLabel::Margin;
134 using MLabel::HorizontalAlignment;
135 using MLabel::VerticalAlignment;
136 using MLabel::Text;
137
142 explicit
143 Button(const Rect& = {}, const Drawing::Font& = {}, Color
144 = Drawing::ColorSpace::Black, TextAlignment = TextAlignment::Center);
149 Button(const Rect&, Drawing::Hue, const Drawing::Font& = {}, Color
150 = Drawing::ColorSpace::Black, TextAlignment = TextAlignment::Center);
151 DefDeMoveCtor(Button)
152
153
157 void
158 Refresh(PaintEventArgs&&) override;
159 };
160
161 } // namespace UI;
162
163 } // namespace YSLib;
164
165 #endif
166
YSLib::Drawing::Font
字体：字模，包含字型、样式和大小。
Definition: Font.h:583
YSLib::UI::Thumb::ThumbBackground
Definition: Button.h:55
YSLib::UI::CursorState::Pressed
YSLib::UI::Control
控件。
Definition: YControl.h:275
YSLib::Consoles::Black
Definition: YConsole.h:53
YSLib::UI::MLabel::Margin
Drawing::Padding Margin
文本和容器的间距。
Definition: Label.h:79
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45
platform::Color
颜色。
Definition: Video.h:451
YSLib::UI::Button
按钮。
Definition: Button.h:127
YSLib::UI::MLabel::ForeColor
Color ForeColor
默认前景色。
Definition: Label.h:77
YSLib::UI::CursorState
CursorState
指针设备光标相对控件的状态。
Definition: YControl.h:344
Color
Pixel Color
Definition: CharRenderer.cpp:58
YSLib::UI::TextAlignment
TextAlignment
Definition: Label.h:45
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:240
YSLib::UI::Thumb::csCurrent
CursorState csCurrent
指针设备光标状态。
Definition: Button.h:70
YSLib::UI::BorderArea::Center
YSLib::ynothrow
YB_PURE const _type size_t n ynothrow
Definition: YCoreUtilities.h:168
YSLib::UI::Thumb::StyleItem
StyleItem
视觉样式项目。
Definition: Button.h:53
YSLib::Drawing::Rect
屏幕标准矩形：表示屏幕矩形区域。
Definition: YGDIBase.h:540
DefDeMoveCtor
#define DefDeMoveCtor(_t)
Definition: YBaseMacro.h:166
ystdex::raw_tag
直接构造类型（直接构造重载用）。
Definition: ydef.h:909
UI
YSLib::UI::Styles::StyleItem
size_t StyleItem
标识样式渲染项的类型。
Definition: YStyle.h:374
YSLib::UI::MLabel::VerticalAlignment
TextAlignment VerticalAlignment
Definition: Label.h:86
YModules.h
YSLib::UI::MLabel::Text
String Text
标签文本。
Definition: Label.h:94
YSLib::UI::Thumb
基本按钮。
Definition: Button.h:46
YSLib::UI::PaintEventArgs
部件绘制参数。
Definition: YWidgetEvent.h:323
YF_API
#define YF_API
Definition: Platform.h:56
DefPred
#define DefPred(_q, _n,...)
Definition: YBaseMacro.h:231
YSLib::UI::MLabel::Font
Drawing::Font Font
字体。
Definition: Label.h:78
YSLib::UI::MLabel
标签模块。
Definition: Label.h:61
YSLib::UI::MLabel::HorizontalAlignment
TextAlignment HorizontalAlignment
文本水平和竖直对齐属性。
Definition: Label.h:85