2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUi_ContainerImpl.cpp
20 * @brief This is the implementation file for _ContainerImpl class.
23 #include <FUiLayout.h>
24 #include <FBaseSysLog.h>
25 #include <FApp_AppInfo.h>
26 #include "FUi_ContainerImpl.h"
27 #include "FUi_WindowImpl.h"
28 #include "FUi_Control.h"
29 #include "FUi_CoordinateSystemUtils.h"
30 #include "FUi_LayoutImpl.h"
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Collection;
35 using namespace Tizen::Graphics;
37 namespace Tizen { namespace Ui {
40 _ContainerImpl::CreateContainerImplN(Container* pPublic)
44 _Control* pCore = _Control::CreateControlN();
45 result r = GetLastResult();
46 SysTryReturn(NID_UI, pCore, null, r, "[%s] Propagating.", GetErrorMessage(r));
48 _ContainerImpl* pImpl = new (std::nothrow) _ContainerImpl(pPublic, pCore);
49 r = CheckConstruction(pCore, pImpl);
50 SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
56 _ContainerImpl::CreateContainerImplN(Container* pPublic, const Rectangle& bounds,
57 const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout,
58 bool resizable, bool movable)
62 _Control* pCore = _Control::CreateControlN();
63 SysTryReturn(NID_UI, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
65 _ContainerImpl* pImpl =
66 new (std::nothrow) _ContainerImpl(pPublic, pCore, bounds,
67 pPublicPortraitLayout, pPublicLandscapeLayout,
69 r = CheckConstruction(pCore, pImpl);
70 SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
78 _ContainerImpl::CreateContainerImplN(Container* pPublic, const FloatRectangle& bounds,
79 const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout,
80 bool resizable, bool movable)
84 _Control* pCore = _Control::CreateControlN();
85 SysTryReturn(NID_UI, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
87 _ContainerImpl* pImpl =
88 new (std::nothrow) _ContainerImpl(pPublic, pCore, bounds,
89 pPublicPortraitLayout, pPublicLandscapeLayout,
91 r = CheckConstruction(pCore, pImpl);
92 SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
100 _ContainerImpl::GetInstance(Container& container)
102 return static_cast <_ContainerImpl*> (container._pControlImpl);
105 const _ContainerImpl*
106 _ContainerImpl::GetInstance(const Container& container)
108 return static_cast <const _ContainerImpl*> (container._pControlImpl);
111 _ContainerImpl::~_ContainerImpl(void)
122 _ContainerImpl::GetPublicClassName(void) const
124 return "Tizen::Ui::Container";
128 _ContainerImpl::GetPublic(void) const
130 return static_cast <const Container&>(_ControlImpl::GetPublic());
134 _ContainerImpl::GetPublic(void)
136 return static_cast <Container&>(_ControlImpl::GetPublic());
139 // E_INVALID_ARG, E_OUT_OF_MEMORY
141 _ContainerImpl::AddChild(_ControlImpl* pChild, bool transferOwnership)
144 result r = E_SUCCESS;
147 pChild != null, E_INVALID_ARG,
148 E_INVALID_ARG, "[E_INVALID_ARG] The specified child is not constructed.");
151 IsChildAttachable(*pChild), E_INVALID_ARG,
152 E_INVALID_ARG, "[E_INVALID_ARG] %s cannot be a child of %s.",
153 pChild->GetPublicClassName(), GetPublicClassName());
155 _ContainerImpl* pOldParent = pChild->GetParent();
158 (pOldParent != this), E_INVALID_ARG,
159 E_INVALID_ARG, "[E_INVALID_ARG] The child control is already attached to this container.");
162 pOldParent == null, E_INVALID_ARG,
163 E_INVALID_ARG, "[E_INVALID_ARG] Unable to add the child which already has another parent.");
165 r = __controlPublics.Add(pChild->GetPublic());
168 SysAssert(r == E_OUT_OF_MEMORY); // I can't beleve Tizen::Base.
169 SysLogException(NID_UI, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
170 return E_OUT_OF_MEMORY;
173 r = GetCore().AttachChild(pChild->GetCore());
174 SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] propagated.", GetErrorMessage(r));
180 _ContainerImpl::Destroy(void)
182 result r = E_SUCCESS;
183 _ContainerImpl* pParent = GetParent();
186 r = pParent->RemoveChild(this, true);
190 RemoveAllChildren(true);
197 // E_INVALID_ARG, E_OBJ_NOT_FOUND
199 _ContainerImpl::RemoveChild(_ControlImpl* pChild, bool deallocate)
202 result r = E_SUCCESS;
205 pChild != null, E_INVALID_ARG,
206 E_INVALID_ARG, "[E_INVALID_ARG] The specified child is not constructed.");
208 if (pChild->GetCore().GetArea() == _CONTROL_AREA_SYSTEM)
213 GetChildIndex(pChild);
215 SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
217 r = GetCore().DetachChild(pChild->GetCore());
218 SysAssert(r == E_SUCCESS);
220 r = __controlPublics.Remove(pChild->GetPublic(), deallocate);
221 SysAssert(r == E_SUCCESS);
227 _ContainerImpl::RemoveChild(int index)
230 result r = E_SUCCESS;
232 _ControlImpl* pChild = GetChild(index); // Find child control.
234 SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
237 SysTryReturn(NID_UI, pChild, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The child to remove is null.");
239 GetCore().DetachChild(pChild->GetCore());
240 SysAssert(GetLastResult() == E_SUCCESS);
242 r = __controlPublics.Remove(pChild->GetPublic(), true);
243 SysAssert(r == E_SUCCESS);
249 _ContainerImpl::RemoveAllChildren(bool detachSystemChild)
252 result r = E_SUCCESS;
254 GetCore().DetachAllChildren(detachSystemChild);
255 SysAssert(GetLastResult() == E_SUCCESS);
257 if (detachSystemChild)
259 __controlPublics.RemoveAll(true);
263 int childCount = __controlPublics.GetCount();
268 _ControlImpl* pControl = GetChild(itemIndex);
269 if (pControl->GetCore().GetArea() == _CONTROL_AREA_SYSTEM)
275 r = __controlPublics.Remove(pControl->GetPublic(), true);
276 SysAssert(r == E_SUCCESS);
282 _ContainerImpl::MoveChildToTop(const _ControlImpl& child)
285 result r = E_SUCCESS;
288 child.GetParent() == this, E_INVALID_ARG,
289 E_INVALID_ARG, "[E_INVALID_ARG] Not my child.");
291 r = GetCore().MoveChildToTop(child.GetCore());
292 SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
294 r = __controlPublics.Remove(child.GetPublic());
295 SysAssert(r == E_SUCCESS);
297 r = __controlPublics.Add(child.GetPublic());
298 SysAssert(r == E_SUCCESS);
304 _ContainerImpl::MoveChildBefore(const _ControlImpl& targetChild, const _ControlImpl& child)
307 result r = E_SUCCESS;
311 targetChild.GetParent() == this, E_INVALID_ARG,
312 E_INVALID_ARG, "[E_INVALID_ARG] Not my targetChild.");
315 child.GetParent() == this, E_INVALID_ARG,
316 E_INVALID_ARG, "[E_INVALID_ARG] Not my child.");
318 r = GetCore().MoveChildBefore(targetChild.GetCore(), child.GetCore());
319 SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
321 r = __controlPublics.Remove(child.GetPublic());
322 SysAssert(r == E_SUCCESS);
324 r = __controlPublics.IndexOf(targetChild.GetPublic(), index);
325 SysAssert(r == E_SUCCESS);
327 r = __controlPublics.InsertAt(child.GetPublic(), index);
328 SysAssert(r == E_SUCCESS);
333 Tizen::Base::Collection::IList*
334 _ContainerImpl::GetChildrenPublic(void) const
337 return const_cast <LinkedList*>(&__controlPublics);
342 _ContainerImpl::GetChild(int index) const
346 const Control* pControl = static_cast <const Control*>(__controlPublics.GetAt(index));
347 result r = GetLastResult();
350 SysAssert(r == E_OUT_OF_RANGE); // I can't beleve Tizen::Base.
351 SysLogException(NID_UI,
352 E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range (index = %d, count = %d.)",
353 index, GetChildCount());
360 return const_cast <_ControlImpl*>(_ControlImpl::GetInstance(*pControl));
364 _ContainerImpl::SearchControlByName(const Tizen::Base::String& name, bool recursive, bool searchMyself) const
368 if (searchMyself == true || (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()))
370 if (name.CompareTo(GetName()) == 0)
372 return const_cast <_ContainerImpl*>(this);
376 _ControlImpl* pChildFound = null;
377 for (int i = 0; i < __controlPublics.GetCount(); ++i)
379 _ControlImpl* pChild = GetChild(i);
387 _ContainerImpl* pChildAsContainer = dynamic_cast <_ContainerImpl*>(pChild);
388 if (pChildAsContainer && recursive)
390 pChildFound = pChildAsContainer->SearchControlByName(name, true, true);
391 if (pChildFound != null)
396 else if (name.CompareTo(pChild->GetName()) == 0)
398 pChildFound = pChild;
406 // [ToDo] Check if the public Container leaves the out-param index as it is.
408 _ContainerImpl::GetChildIndex(const _ControlImpl* pChild) const
412 result r = __controlPublics.IndexOf(pChild->GetPublic(), index);
415 SysAssert(r == E_OBJ_NOT_FOUND);
416 SysLogException(NID_UI, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The control is not a child of this container.");
424 _ContainerImpl::GetChildCount(void) const
427 return __controlPublics.GetCount();
431 _ContainerImpl::GetPublicPortraitLayoutN(void) const
435 Layout* pLayout = _LayoutImpl::CreatePublicLayoutN(__portraitLayout);
436 result r = GetLastResult();
437 SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
443 _ContainerImpl::GetPublicLandscapeLayoutN(void) const
447 Layout* pLayout = _LayoutImpl::CreatePublicLayoutN(__landscapeLayout);
448 result r = GetLastResult();
449 SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
455 _ContainerImpl::GetPublicLayoutN(void) const
457 return (GetCore().GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) ?
458 GetPublicLandscapeLayoutN() : GetPublicPortraitLayoutN();
462 _ContainerImpl::SetChildAt(const _ControlImpl* pChild, int index)
465 result r = E_SUCCESS;
468 pChild, E_INVALID_ARG,
469 E_INVALID_ARG, "[E_INVALID_ARG] The specified child is not constructed.");
471 // In API 2.0, (0 <= index) was not checked but checked at the ArrayList::SetAt().
472 // So, I check the case here. No problem.
474 (0 <= index && index < GetCore().GetChildCount()), E_OUT_OF_RANGE,
475 E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range (index = %d, count = %d)",
476 index, GetCore().GetChildCount());
478 // [ToDo] 2.0 bug: The error should be E_INVALID_ARG.
479 // And I think this must be checked before the range check.
480 _ContainerImpl* pParent = pChild->GetParent();
482 pParent == this, E_SYSTEM,
483 E_SYSTEM, "[E_SYSTEM] The container is not the parent of the specified control.");
485 int oldIndex = GetCore().GetChildIndex(pChild->GetCore());
486 SysAssert(GetLastResult() == E_SUCCESS);
488 if (index == oldIndex)
493 r = __controlPublics.SetAt(pChild->GetPublic(), index);
494 SysAssert(r == E_SUCCESS);
496 _Control* pTargetChild = GetCore().GetChild(index);
497 SysAssert(pTargetChild);
499 r = GetCore().MoveChildBefore(*pTargetChild, pChild->GetCore());
500 SysAssert(r == E_SUCCESS);
506 _ContainerImpl::IsAncestorOf(const _ControlImpl* pChild) const
508 SysTryReturn(NID_UI, pChild, false, E_INVALID_ARG, "[E_INVALID_ARG] The specified child is not constructed.");
509 return GetCore().IsAncestorOf(pChild->GetCore());
513 _ContainerImpl::OnDraw(void)
515 GetPublic().OnClearBackground();
517 if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
522 GetPublic().OnDraw();
526 _ContainerImpl::OnChangeLayout(_ControlOrientation orientation)
528 result r = E_SUCCESS;
529 _ControlImpl::OnChangeLayout(orientation);
531 if (orientation == _CONTROL_ORIENTATION_PORTRAIT && !__portraitLayout.IsNull())
533 r = GetCore().SetCurrentLayout(__portraitLayout->GetCore());
534 SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Failed to set up the current layout as portrait");
536 else if (orientation == _CONTROL_ORIENTATION_LANDSCAPE && !__landscapeLayout.IsNull())
538 r = GetCore().SetCurrentLayout(__landscapeLayout->GetCore());
539 SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Failed to set up the current layout as landscape.");
544 _ContainerImpl::OnVisibleStateChanging(void)
546 GetPublic().OnShowStateChanging(GetVisibleState());
547 _ControlImpl::OnVisibleStateChanging();
551 _ContainerImpl::OnVisibleStateChanged(void)
553 _ControlImpl::OnVisibleStateChanged();
554 GetPublic().OnShowStateChanged(GetVisibleState());
558 _ContainerImpl::OnBoundsChanging(const Rectangle& bounds)
560 _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic());
563 GetPublic().OnBoundsChanging(_CoordinateSystemUtils::ConvertToInteger(__oldBounds), bounds);
566 return _ControlImpl::OnBoundsChanging(bounds);
570 _ContainerImpl::OnBoundsChanging(const FloatRectangle& bounds)
572 _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic());
575 GetPublic().OnBoundsChanging(__oldBounds, bounds);
577 return _ControlImpl::OnBoundsChanging(bounds);
581 _ContainerImpl::OnBoundsChanged(void)
583 _ControlImpl::OnBoundsChanged();
584 _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic());
587 GetPublic().OnBoundsChanged(_CoordinateSystemUtils::ConvertToInteger(__oldBounds), GetBounds());
588 GetPublic().OnBoundsChanged(__oldBounds, GetBoundsF());
593 _ContainerImpl::OnEvaluateSize(Dimension& evaluatedSize)
595 _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic());
598 GetPublic().OnEvaluateSize(evaluatedSize);
600 _ControlImpl::OnEvaluateSize(evaluatedSize);
604 _ContainerImpl::OnEvaluateSize(FloatDimension& evaluatedSize)
606 _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic());
607 bool changed = false;
610 changed = GetPublic().OnEvaluateSize(evaluatedSize);
612 _ControlImpl::OnEvaluateSize(evaluatedSize);
617 _ContainerImpl::CallOnDraw(void)
619 if (!_AppInfo::IsOspCompat())
626 _ContainerImpl::Initialize(Control* pPublic, _Control* pCore, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout)
628 result r = GetLastResult();
634 _SharedPtr <Tizen::Ui::_LayoutImpl> spPortraitLayout;
635 _SharedPtr <Tizen::Ui::_LayoutImpl> spLandscapeLayout;
637 // Check if all or none
639 (pPublicPortraitLayout && pPublicLandscapeLayout) ||
640 (!pPublicPortraitLayout && !pPublicLandscapeLayout)
643 if (pPublicPortraitLayout)
645 r = SetLayout(*pCore, _CONTROL_ORIENTATION_PORTRAIT, pPublicPortraitLayout);
651 r = pCore->SetCurrentLayout(__portraitLayout->GetCore());
652 SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Failed to set up the current layout.");
655 if (pPublicLandscapeLayout)
657 r = SetLayout(*pCore, _CONTROL_ORIENTATION_LANDSCAPE, pPublicLandscapeLayout);
665 _ContainerImpl::_ContainerImpl(Control* pPublic, _Control* pCore, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout)
666 : _ControlImpl(pPublic, pCore)
668 Initialize(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout);
671 _ContainerImpl::_ContainerImpl(Control* pPublic, _Control* pCore, const Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable)
672 : _ControlImpl(pPublic, pCore)
674 result r = E_SUCCESS;
676 Initialize(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout);
684 bool allOrNone = (pPublicPortraitLayout && pPublicLandscapeLayout) || (!pPublicPortraitLayout && !pPublicLandscapeLayout);
685 SysAssert(allOrNone);
687 r = SetBounds(bounds);
688 SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
690 pCore->SetResizable(resizable);
691 pCore->SetMovable(movable);
694 _ContainerImpl::_ContainerImpl(Control* pPublic, _Control* pCore, const FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable)
695 : _ControlImpl(pPublic, pCore)
697 result r = E_SUCCESS;
699 Initialize(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout);
707 bool allOrNone = (pPublicPortraitLayout && pPublicLandscapeLayout) || (!pPublicPortraitLayout && !pPublicLandscapeLayout);
708 SysAssert(allOrNone);
710 r = SetBounds(bounds);
711 SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
713 pCore->SetResizable(resizable);
714 pCore->SetMovable(movable);
718 _ContainerImpl::SetLayout(_Control& core, _ControlOrientation orientation, const Layout* pPublicLayout)
720 SysAssert(pPublicLayout);
722 result r = E_SUCCESS;
724 const char* orientationStatus = (orientation == _CONTROL_ORIENTATION_PORTRAIT) ?
725 "portrait" : "landscape";
727 _SharedPtr <Tizen::Ui::_LayoutImpl>& spLayout = (orientation == _CONTROL_ORIENTATION_PORTRAIT) ?
728 __portraitLayout : __landscapeLayout;
730 spLayout = _LayoutImpl::GetLayoutImpl(const_cast <Layout*>(pPublicLayout));
732 !spLayout.IsNull(), E_INVALID_ARG,
733 E_INVALID_ARG, "[E_INVALID_ARG] The %s layout is invalid object", orientationStatus);
735 r = core.AddLayout(spLayout->GetCore());
741 SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] The %s layout is already used.", orientationStatus);
744 SysLogException(NID_UI, E_SYSTEM, "[E_SYSTEM] Failed to add the %s layout.", orientationStatus);
754 _ContainerImpl::IsChildAttachable(_ControlImpl& child) const
756 if (dynamic_cast <_WindowImpl*>(&child) != null)
766 _ContainerImpl::SetControlAlwaysOnTop(Control& control, bool alwaysOnTop)
768 _ControlImpl* pChild = _ControlImpl::GetInstance(control);
770 pChild, E_INVALID_ARG,
771 E_INVALID_ARG, "[E_INVALID_ARG] The specified chlid control is not constructed.");
773 _Control& childCore = pChild->GetCore();
774 const bool atBottom = childCore.GetLayer() == _CONTROL_LAYER_CLIENT_BOTTOM;
776 if (atBottom && !alwaysOnTop)
778 SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The bottom child cannot be reset.");
779 return E_INVALID_OPERATION;
783 GetCore().SetChildAlwaysOnTop(childCore) :
784 GetCore().ResetChildLayer(childCore);
788 _ContainerImpl::SetControlAlwaysAtBottom(Control& control, bool alwaysAtBottom)
790 _ControlImpl* pChild = _ControlImpl::GetInstance(control);
792 pChild, E_INVALID_ARG,
793 E_INVALID_ARG, "[E_INVALID_ARG] The specified chlid control is not constructed.");
795 _Control& childCore = pChild->GetCore();
796 const bool onTop = childCore.GetLayer() == _CONTROL_LAYER_CLIENT_TOP;
798 if (onTop && !alwaysAtBottom)
800 SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The top child cannot be reset.");
801 return E_INVALID_OPERATION;
804 return alwaysAtBottom ?
805 GetCore().SetChildAlwaysAtBottom(childCore) :
806 GetCore().ResetChildLayer(childCore);
810 _ContainerImpl::IsControlAlwaysAtBottom(const Control& control) const
812 const _ControlImpl* pChild = _ControlImpl::GetInstance(control);
815 E_INVALID_ARG, "[E_INVALID_ARG] The specified chlid control is not constructed.");
818 pChild->GetParent() == this, false,
819 E_INVALID_ARG, "[E_INVALID_ARG] The specified chlid control is not a child of this container.");
821 return pChild->GetCore().GetLayer() == _CONTROL_LAYER_CLIENT_BOTTOM;
825 _ContainerImpl::IsControlAlwaysOnTop(const Control& control) const
827 const _ControlImpl* pChild = _ControlImpl::GetInstance(control);
830 E_INVALID_ARG, "[E_INVALID_ARG] The specified chlid control is not constructed.");
833 pChild->GetParent() == this, false,
834 E_INVALID_ARG, "[E_INVALID_ARG] The specified chlid control is not a child of this container.");
836 return pChild->GetCore().GetLayer() == _CONTROL_LAYER_CLIENT_TOP;