本文整理汇总了C++中CDockBar::FindBar方法的典型用法代码示例。如果您正苦于以下问题:C++ CDockBar::FindBar方法的具体用法?C++ CDockBar::FindBar怎么用?C++ CDockBar::FindBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDockBar
的用法示例。
在下文中一共展示了CDockBar::FindBar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReDockControlBar
void CFrameWnd::ReDockControlBar(CControlBar* pBar, CDockBar* pDockBar, LPCRECT lpRect)
{
ASSERT(pBar != NULL);
// make sure CControlBar::EnableDocking has been called
ASSERT(pBar->m_pDockContext != NULL);
if (pDockBar == NULL)
{
// Search for the place holder.
// In case we don't find a place holder, find a bar with the correct alignment
// and keep it in pPossibleBar.
CDockBar* pPossibleBar = NULL;
for (int i = 0; i < 4; i++)
{
CDockBar* pTempBar = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
if (pTempBar != NULL)
{
// Is this the same bar we docked with before?
if (pTempBar->FindBar((CControlBar*)_AfxGetDlgCtrlID(pBar->m_hWnd)) > 0)
{
pDockBar = pTempBar;
break;
}
}
if ((dwDockBarMap[i][1] & CBRS_ALIGN_ANY) ==
(pBar->m_dwStyle & CBRS_ALIGN_ANY))
{
pPossibleBar = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
ASSERT(pPossibleBar != NULL);
// assert fails when initial CBRS_ of bar does not
// match available docking sites, as set by EnableDocking()
}
}
// Did we find the place holder?
if (pDockBar == NULL)
pDockBar = pPossibleBar;
}
ASSERT(pDockBar != NULL);
ASSERT(m_listControlBars.Find(pBar) != NULL);
ASSERT(pBar->m_pDockSite == this);
// if this assertion occurred it is because the parent of pBar was not initially
// this CFrameWnd when pBar's OnCreate was called
// i.e. this control bar should have been created with a different parent initially
pDockBar->ReDockControlBar(pBar, lpRect);
}