YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
button.h
浏览该文件的文档.
1 /*
2  © 2010-2014 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:
54  {
56  EndStyle
57  };
58 
59 protected:
65 
66 private:
68  Drawing::Hue hue = 180;
69 
70 public:
75  explicit
76  Thumb(const Rect& = {}, Drawing::Hue = 180);
77 
78 protected:
83  explicit
84  Thumb(const Rect&, ystdex::raw_tag);
85 
86 public:
88 
89 
93  DefPred(const ynothrow, Pressed, csCurrent == CursorState::Pressed)
94 
96  DefGetter(const ynothrow, CursorState, CursorState, csCurrent)
98  DefGetter(const ynothrow, Hue, Hue, hue)
99 };
100 
108 YF_API void
110 
111 
116 class YF_API Button : public Thumb, protected MLabel
117 {
118 public:
119  using MLabel::Font;
120  using MLabel::Margin;
123  using MLabel::Text;
124 /*
125  YImage BackgroundImage; //!< 背景图像。
126  YImage Image; //!< 前景图像。
127 */
128 
133  explicit
134  Button(const Rect& = {}, const Drawing::Font& = {},
140  Button(const Rect&, Drawing::Hue, const Drawing::Font& = {},
143 
144 
148  void
149  Refresh(PaintEventArgs&&) override;
150 };
151 
152 } // namespace UI;
153 
154 } // namespace YSLib;
155 
156 #endif
157 
size_t StyleItem
标识样式渲染项的类型。
Definition: ystyle.h:250
void Refresh(PaintEventArgs &&) override
刷新:按指定参数绘制界面并更新状态。
#define DefPred(_q, _n,...)
Definition: YBaseMacro.h:172
Drawing::Font Font
字体。
Definition: label.h:61
部件绘制参数。
Definition: ywgtevt.h:276
#define YF_API
Definition: Platform.h:64
按钮。
Definition: button.h:116
基本按钮。
Definition: button.h:46
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:180
控件。
Definition: ycontrol.h:275
String Text
标签文本。
Definition: label.h:76
CursorState
指针设备光标相对于控件的状态。
Definition: ycontrol.h:345
CursorState csCurrent
指针设备光标状态。
Definition: button.h:64
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
屏幕标准矩形:表示屏幕矩形区域。
Definition: ygdibase.h:416
TextAlignment HorizontalAlignment
文本水平和竖直对齐属性。
Definition: label.h:68
Drawing::Padding Margin
文本和容器的间距。
Definition: label.h:62
TextAlignment
Definition: label.h:44
Selected const shared_ptr< ListType > const pair< Color, Color > & DefDeMoveCtor(TextList) DefPredMem(const ynothrow
空基类模板。
Definition: ydef.h:658
标签模块。
Definition: label.h:58
字体:字模,包含字型、样式和大小。
Definition: Font.h:546
void DecorateAsCloseButton(Thumb &tmb)
Definition: button.cpp:127
StyleItem
视觉样式项目。
Definition: button.h:53
TextAlignment VerticalAlignment
Definition: label.h:68