本文整理汇总了C++中CViewContainer::advanceNextFocusView方法的典型用法代码示例。如果您正苦于以下问题:C++ CViewContainer::advanceNextFocusView方法的具体用法?C++ CViewContainer::advanceNextFocusView怎么用?C++ CViewContainer::advanceNextFocusView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CViewContainer
的用法示例。
在下文中一共展示了CViewContainer::advanceNextFocusView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setModalView
/**
* @param pView the view which should be set to modal.
* @return true if view could be set as the modal view. false if there is a already a modal view or the view to be set as modal is already attached.
*/
bool CFrame::setModalView (CView* pView)
{
if (pView == 0 && pModalView == 0)
return true;
// If there is a modal view or the view
if ((pView && pModalView) || (pView && pView->isAttached ()))
return false;
if (pModalView)
{
removeView (pModalView, false);
}
pModalView = pView;
if (pModalView)
{
bool result = addView (pModalView);
if (result)
{
clearMouseViews (CPoint (0, 0), 0, true);
CViewContainer* container = dynamic_cast<CViewContainer*> (pModalView);
if (container)
container->advanceNextFocusView (0, false);
else
setFocusView (pModalView->wantsFocus () ? pModalView : 0);
}
return result;
}
else
{
CPoint where;
getCurrentMouseLocation (where);
checkMouseViews (where, getCurrentMouseButtons ());
}
return true;
}
示例2: while
//-----------------------------------------------------------------------------
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);
}