本文整理汇总了C++中Dialog::GetZOrdering方法的典型用法代码示例。如果您正苦于以下问题:C++ Dialog::GetZOrdering方法的具体用法?C++ Dialog::GetZOrdering怎么用?C++ Dialog::GetZOrdering使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialog
的用法示例。
在下文中一共展示了Dialog::GetZOrdering方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowDialog
void Screen::ShowDialog(Dialog *pDlg, bool fFade)
{
assert(pDlg);
// do place console mode dialogs
if (Application.isFullScreen || pDlg->IsViewportDialog())
// exclusive or free dlg: center pos
// evaluate own placement proc first
if (!pDlg->DoPlacement(this, PreferredDlgRect))
{
if (pDlg->IsFreePlaceDialog())
pDlg->SetPos((GetWidth() - pDlg->GetWidth()) / 2, (GetHeight() - pDlg->GetHeight()) / 2 + pDlg->IsBottomPlacementDialog()*GetHeight()/3);
else if (IsExclusive())
pDlg->SetPos((GetWidth() - pDlg->GetWidth()) / 2, (GetHeight() - pDlg->GetHeight()) / 2);
else
// non-exclusive mode at preferred viewport pos
pDlg->SetPos(PreferredDlgRect.x+30, PreferredDlgRect.y+30);
}
// add to local component list at correct ordering
int32_t iNewZ = pDlg->GetZOrdering(); Element *pEl; Dialog *pOtherDlg;
for (pEl = GetFirst(); pEl; pEl = pEl->GetNext())
if (pOtherDlg = pEl->GetDlg())
if (pOtherDlg->GetZOrdering() > iNewZ)
break;
InsertElement(pDlg, pEl);
// set as active, if not fading and on top
if (!fFade && !pEl)
// but not viewport dialogs!
if (!pDlg->IsExternalDrawDialog())
pActiveDlg = pDlg;
// show it
pDlg->fOK = false;
pDlg->fShow = true;
// mouse focus might have changed
UpdateMouseFocus();
}