YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ypanel.cpp
浏览该文件的文档.
1 /*
2  © 2011-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 #include "YSLib/UI/YModules.h"
29 #include YFM_YSLib_UI_YPanel
30 
31 namespace YSLib
32 {
33 
34 namespace UI
35 {
36 
38  : Control(r, MakeBlankBrush()), MUIContainer()
39 {}
40 
41 void
42 Panel::operator+=(IWidget& wgt)
43 {
44  MUIContainer::operator+=(wgt);
45  SetContainerPtrOf(wgt, this);
46 }
47 
48 bool
50 {
51  return RemoveFrom(wgt, *this) ? MUIContainer::operator-=(wgt) : false;
52 }
53 
54 void
55 Panel::Add(IWidget& wgt, ZOrderType z)
56 {
57  MUIContainer::Add(wgt, z);
58  SetContainerPtrOf(wgt, this);
59 }
60 
61 void
63 {
64  ClearFocusingOf(*this);
65  mWidgets.clear();
66  SetInvalidationOf(*this);
67 }
68 
69 bool
71 {
72  using ystdex::get_value;
73 
74  auto i(std::find(mWidgets.begin() | get_value, mWidgets.end() | get_value,
75  &wgt));
76 
77  if(i != mWidgets.end())
78  {
79  const ZOrderType z(i.get()->first);
80 
81  mWidgets.erase(i);
82  mWidgets.insert(make_pair(z, static_cast<IWidget*>(&wgt)));
83  Invalidate(wgt);
84  return true;
85  }
86  return false;
87 }
88 
89 void
91 {
92  if(!e.ClipArea.IsUnstrictlyEmpty())
94 }
95 
96 } // namespace UI;
97 
98 } // namespace YSLib;
99 
void Refresh(PaintEventArgs &&) override
刷新:按指定参数绘制界面并更新状态。
Definition: ypanel.cpp:90
YF_API void Invalidate(IWidget &, const Rect &)
无效化:使相对于部件的指定区域在直接和间接的窗口缓冲区中无效。
Definition: ywidget.cpp:111
部件绘制参数。
Definition: ywgtevt.h:276
virtual bool operator-=(IWidget &)
Definition: ypanel.cpp:49
void SetInvalidationOf(IWidget &wgt)
Definition: ywidget.cpp:60
Panel(const Rect &={})
构造:使用指定边界。
Definition: ypanel.cpp:37
控件。
Definition: ycontrol.h:275
YF_API bool RemoveFrom(IWidget &, IWidget &)
从容器中移除部件。
Definition: yuicont.cpp:144
const second_tag get_value
Definition: iterator.hpp:785
_tWidget & wgt
Definition: ywgtevt.h:596
屏幕标准矩形:表示屏幕矩形区域。
Definition: ygdibase.h:416
u8 ZOrderType
Definition: yuicont.h:146
void PaintVisibleChildren(PaintEventArgs &)
绘制可视子部件。
Definition: yuicont.cpp:229
wgt wgt YF_API void ClearFocusingOf(IWidget &)
清除焦点指针并以此部件作为事件源调用被清除焦点部件的 LostFocus 事件。
Definition: yfocus.cpp:112
void ClearContents()
清除内容。
Definition: ypanel.cpp:62
bounds & r
Definition: ydraw.h:220
部件容器模块。
Definition: yuicont.h:279
bool MoveToFront(IWidget &)
提升部件至 Z 顺序相等的同组部件的顶端。
Definition: ypanel.cpp:70