29 #include YFM_YSLib_UI_Border
45 ctlColorArea({164, 32, 32, 32}, MakeBlankBrush()),
46 trRed({4, 24, track_size}), trGreen({4, 48, track_size}),
47 trBlue({4, 72, track_size}), lblRed({120, 24, label_size}),
48 lblGreen({120, 48, label_size}), lblBlue({120, 72, label_size})
50 const auto update_color([
this]{
51 SetColor(
Color(trRed.GetValue(), trGreen.GetValue(),
55 AddWidgets(*
this, ctlColorArea, trRed, trGreen, trBlue, lblRed, lblGreen,
57 trRed.SetMaxValue(255),
58 trGreen.SetMaxValue(255),
59 trBlue.SetMaxValue(255),
62 trRed.GetScroll() += update_color,
63 trGreen.GetScroll() += update_color,
64 trBlue.GetScroll() += update_color
70 ColorBox::GetColorRef()
const
75 throw LoggedEvent(
"Invalid brush found @ ColorBox::GetColor");
83 trRed.SetValue(c.GetR()),
Control ctlColorArea
颜色区域。
ColorBox(const Point &, Color c=ColorSpace::White)
YF_API void Invalidate(IWidget &, const Rect &)
无效化:使相对于部件的指定区域在直接和间接的窗口缓冲区中无效。
void SetColor(Color)
取当前选定的颜色。
yconstexpr EventPriority BoundaryPriority(0x60)
void AddWidgets(_tCon &con, _tWidgets &...wgts)
向部件容器添加子部件。
#define yunseq
无序列依赖表达式组求值。
HorizontalTrack trRed
颜色分量轨道。
std::string to_string(unsigned char val)
转换为字符串。
#define yconstexpr
指定编译时常量表达式。