本文整理汇总了C++中CControlBar::MoveWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlBar::MoveWindow方法的具体用法?C++ CControlBar::MoveWindow怎么用?C++ CControlBar::MoveWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlBar
的用法示例。
在下文中一共展示了CControlBar::MoveWindow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowSelectedTab
void COXDockTabCtrl::ShowSelectedTab()
{
int iSelected = GetCurSel();
// Show first
for (int i = 0; i < GetItemCount(); i++)
{
CControlBar* pBar = GetBar(i);
if (iSelected == i)
{
pBar->GetDockingFrame()->ShowControlBar(pBar, TRUE, TRUE); // show
}
else
{
pBar->GetDockingFrame()->ShowControlBar(pBar, FALSE, TRUE); // hide
}
}
CRect rect;
m_pSizeDockBar->GetClientRect(rect);
CControlBar* pBar = GetBar(iSelected);
if (pBar != NULL)
{
COXSizeControlBar* pSizeBar = DYNAMIC_DOWNCAST(COXSizeControlBar, pBar);
if (m_pSizeDockBar->IsBarHorizontal())
{
if (m_pLastSelectedBar != NULL)
{
pSizeBar->m_HorzDockSize.cx = m_pLastSelectedBar->m_HorzDockSize.cx;
}
m_pLastSelectedBar = pSizeBar;
}
else // vertical
{
CFrameWnd* pMF = (CFrameWnd*) GetParentFrame();//AfxGetMainWnd();
if (pMF != NULL)
{
if (pMF->GetControlBar(AFX_IDW_DOCKBAR_LEFT) == m_pSizeDockBar)
rect.right -= 3;
if (pMF->GetControlBar(AFX_IDW_DOCKBAR_RIGHT) == m_pSizeDockBar)
rect.left += 4;
}
rect.bottom -= m_pSizeDockBar->GetTabHeight();
pBar->MoveWindow(rect, TRUE);
COXSizeControlBar* pSizeBar = DYNAMIC_DOWNCAST(COXSizeControlBar, pBar);
if (pSizeBar)
{
pSizeBar->m_VertDockSize.cx = rect.Width();
pSizeBar->m_VertDockSize.cy = rect.Height() + 5;
}
}
}
}
示例2: AlignControlBars
void CSizingControlBar::AlignControlBars()
{
int nFirst, nLast, nThis;
GetRowInfo(nFirst, nLast, nThis);
BOOL bHorz = IsHorzDocked();
BOOL bNeedRecalc = FALSE;
int nPos, nAlign = bHorz ? -2 : 0;
CRect rc, rcDock;
m_pDockBar->GetWindowRect(&rcDock);
for (int i = nFirst; i <= nLast; i++)
{
CControlBar* pBar = (CControlBar*)m_pDockBar->m_arrBars[i];
if (HIWORD(pBar) == 0) continue; // placeholder
if (!pBar->IsVisible()) continue;
pBar->GetWindowRect(&rc);
rc.OffsetRect(-rcDock.TopLeft());
if ((nPos = FindSizingBar(pBar)) >= 0)
rc = CRect(rc.TopLeft(), bHorz ?
m_arrBars[nPos]->m_szHorz : m_arrBars[nPos]->m_szVert);
if ((bHorz ? rc.left : rc.top) != nAlign)
{
if (!bHorz)
rc.OffsetRect(0, nAlign - rc.top - 2);
else if (m_nDockBarID == AFX_IDW_DOCKBAR_TOP)
rc.OffsetRect(nAlign - rc.left, -2);
else
rc.OffsetRect(nAlign - rc.left, 0);
pBar->MoveWindow(rc);
bNeedRecalc = TRUE;
}
nAlign += (bHorz ? rc.Width() : rc.Height()) - 2;
}
if (bNeedRecalc)
{
m_pDockSite->DelayRecalcLayout();
TRACE(_T("ccc\n"));
}
}