本文整理汇总了C++中CViewContainer::isChild方法的典型用法代码示例。如果您正苦于以下问题:C++ CViewContainer::isChild方法的具体用法?C++ CViewContainer::isChild怎么用?C++ CViewContainer::isChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CViewContainer
的用法示例。
在下文中一共展示了CViewContainer::isChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onViewRemoved
/**
* @param pView view which was removed
*/
void CFrame::onViewRemoved (CView* pView)
{
removeFromMouseViews (pView);
if (pActiveFocusView == pView)
pActiveFocusView = 0;
if (pFocusView == pView)
setFocusView (0);
CViewContainer* container = dynamic_cast<CViewContainer*> (pView);
if (container)
{
if (container->isChild (pFocusView, true))
setFocusView (0);
}
if (getViewAddedRemovedObserver ())
getViewAddedRemovedObserver ()->onViewRemoved (this, pView);
if (pAnimator)
pAnimator->removeAnimations (pView);
}
示例2: checkMouseViews
//-----------------------------------------------------------------------------
void CFrame::checkMouseViews (const CPoint& where, const CButtonState& buttons)
{
if (mouseDownView)
return;
CPoint lp;
CView* mouseView = getViewAt (where, GetViewOptions (GetViewOptions::kDeep|GetViewOptions::kMouseEnabled|GetViewOptions::kIncludeViewContainer));
CView* currentMouseView = pMouseViews.empty () == false ? pMouseViews.back () : 0;
if (currentMouseView == mouseView)
return; // no change
if (pTooltips)
{
if (currentMouseView)
pTooltips->onMouseExited (currentMouseView);
if (mouseView && mouseView != this)
pTooltips->onMouseEntered (mouseView);
}
if (mouseView == 0 || mouseView == this)
{
clearMouseViews (where, buttons);
return;
}
CViewContainer* vc = currentMouseView ? dynamic_cast<CViewContainer*> (currentMouseView) : 0;
// if the currentMouseView is not a view container, we know that the new mouseView won't be a child of it and that all other
// views in the list are viewcontainers
if (vc == 0 && currentMouseView)
{
lp = where;
currentMouseView->frameToLocal (lp);
currentMouseView->onMouseExited (lp, buttons);
callMouseObserverMouseExited (currentMouseView);
#if DEBUG_MOUSE_VIEWS
DebugPrint ("mouseExited : %p\n", currentMouseView);
#endif
currentMouseView->forget ();
pMouseViews.remove (currentMouseView);
}
ViewList::reverse_iterator it = pMouseViews.rbegin ();
while (it != pMouseViews.rend ())
{
vc = static_cast<CViewContainer*> ((*it));
if (vc == mouseView)
return;
if (vc->isChild (mouseView, true) == false)
{
lp = where;
vc->frameToLocal (lp);
vc->onMouseExited (lp, buttons);
callMouseObserverMouseExited (vc);
#if DEBUG_MOUSE_VIEWS
DebugPrint ("mouseExited : %p\n", vc);
#endif
vc->forget ();
pMouseViews.erase (--it.base ());
}
else
break;
}
vc = pMouseViews.empty () == false ? dynamic_cast<CViewContainer*> (pMouseViews.back ()) : 0;
if (vc)
{
ViewList::iterator it2 = pMouseViews.end ();
it2--;
while ((vc = static_cast<CViewContainer*> (mouseView->getParentView ())) != *it2)
{
pMouseViews.insert (it2, vc);
vc->remember ();
mouseView = vc;
}
pMouseViews.push_back (mouseView);
mouseView->remember ();
it2++;
while (it2 != pMouseViews.end ())
{
lp = where;
(*it2)->frameToLocal (lp);
(*it2)->onMouseEntered (lp, buttons);
callMouseObserverMouseEntered ((*it2));
#if DEBUG_MOUSE_VIEWS
DebugPrint ("mouseEntered : %p\n", (*it2));
#endif
it2++;
}
}
else
{
// must be pMouseViews.size () == 0
assert (pMouseViews.empty ());
pMouseViews.push_back (mouseView);
mouseView->remember ();
while ((vc = static_cast<CViewContainer*> (mouseView->getParentView ())) != this)
{
pMouseViews.push_front (vc);
vc->remember ();
mouseView = vc;
}
ViewList::iterator it2 = pMouseViews.begin ();
while (it2 != pMouseViews.end ())
//.........这里部分代码省略.........
示例3: advanceNextFocusView
//-----------------------------------------------------------------------------
bool CFrame::advanceNextFocusView (CView* oldFocus, bool reverse)
{
if (pModalView)
{
CViewContainer* container = dynamic_cast<CViewContainer*> (pModalView);
if (container)
{
if (oldFocus == 0 || container->isChild (oldFocus, true) == false)
return container->advanceNextFocusView (0, reverse);
else
{
CViewContainer* parentView = static_cast<CViewContainer*> (oldFocus->getParentView ());
if (parentView)
{
CView* tempOldFocus = oldFocus;
while (parentView != container)
{
if (parentView->advanceNextFocusView (tempOldFocus, reverse))
return true;
else
{
tempOldFocus = parentView;
parentView = static_cast<CViewContainer*> (parentView->getParentView ());
}
}
if (container->advanceNextFocusView (tempOldFocus, reverse))
return true;
return container->advanceNextFocusView (0, reverse);
}
}
}
else if (oldFocus != pModalView)
{
setFocusView (pModalView);
return true;
}
return false; // currently not supported, but should be done sometime
}
if (oldFocus == 0)
{
if (pFocusView == 0)
return CViewContainer::advanceNextFocusView (0, reverse);
oldFocus = pFocusView;
}
if (isChild (oldFocus))
{
if (CViewContainer::advanceNextFocusView (oldFocus, reverse))
return true;
else
{
setFocusView (0);
return false;
}
}
CViewContainer* parentView = static_cast<CViewContainer*> (oldFocus->getParentView ());
if (parentView)
{
CView* tempOldFocus = oldFocus;
while (parentView)
{
if (parentView->advanceNextFocusView (tempOldFocus, reverse))
return true;
else
{
tempOldFocus = parentView;
parentView = static_cast<CViewContainer*> (parentView->getParentView ());
}
}
}
return CViewContainer::advanceNextFocusView (oldFocus, reverse);
}