YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ywindow.cpp
浏览该文件的文档.
1 /*
2  © 2009-2013 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_YDesktop
30 #include YFM_YSLib_UI_YBrush
31 
32 namespace YSLib
33 {
34 
35 using namespace Drawing;
36 
37 namespace UI
38 {
39 
40 Window::Window(const Rect& r, unique_ptr<Renderer> p_renderer)
41  : Panel(r)
42 {
43  if(p_renderer)
44  SetRenderer(std::move(p_renderer));
45 }
46 
47 void
48 Window::operator+=(IWidget& wgt)
49 {
50  MUIContainer::operator+=(wgt);
51  SetContainerPtrOf(wgt, this);
52 }
53 void
55 {
56  MUIContainer::Add(wnd, DefaultWindowZOrder);
57  SetContainerPtrOf(wnd, this);
58 }
59 
60 bool
62 {
63  if(FetchContainerPtr(wgt) == this)
64  {
65  SetContainerPtrOf(wgt);
66  if(FetchFocusingPtr(*this) == &wgt)
67  GetView().FocusingPtr = {};
68  return MUIContainer::operator-=(wgt);
69  }
70  return false;
71 }
72 bool
74 {
75  if(FetchContainerPtr(wnd) == this)
76  {
77  SetContainerPtrOf(wnd);
78  if(FetchFocusingPtr(*this) == &wnd)
79  GetView().FocusingPtr = {};
80  return MUIContainer::operator-=(wnd);
81  }
82  return false;
83 }
84 
85 void
87 {
88  MUIContainer::Add(wgt, z);
89  SetContainerPtrOf(wgt, this);
90 }
91 
92 } // namespace UI;
93 
94 } // namespace YSLib;
95 
Window(const Rect &={}, unique_ptr< Renderer >=make_unique< BufferedRenderer >())
构造:使用指定边界并设置渲染器。
Definition: ywindow.cpp:40
窗口。
Definition: ywindow.h:44
面板。
Definition: ypanel.h:45
void Add(IWidget &, ZOrderType=DefaultZOrder) override
Definition: ywindow.cpp:86
_tWidget & wgt
Definition: ywgtevt.h:596
屏幕标准矩形:表示屏幕矩形区域。
Definition: ygdibase.h:416
u8 ZOrderType
Definition: yuicont.h:146
virtual void operator+=(Window &)
Definition: ywindow.cpp:54
bool operator-=(IWidget &) override
Definition: ywindow.cpp:61
bounds & r
Definition: ydraw.h:220
AController *controller_ptr Renderer *renderer_ptr View *view_ptr GetView()) DefGetterMem(const ynothrow
const ZOrderType DefaultWindowZOrder(128)
默认窗口 Z 顺序值。
pt pt Y FetchFocusingPtr
Definition: ywidget.h:140