本文整理汇总了C++中CControlBar::GetDockingFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlBar::GetDockingFrame方法的具体用法?C++ CControlBar::GetDockingFrame怎么用?C++ CControlBar::GetDockingFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlBar
的用法示例。
在下文中一共展示了CControlBar::GetDockingFrame方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: InsertTab
// Inserts the given control bar as a new tab
void COXDockTabCtrl::InsertTab(CControlBar* pBar, int iIndex, BOOL bShowSelectedTab)
{
// If this is the only control bar in the dock bar do nothing
int iSizeControlBarCount = m_pSizeDockBar->GetSizeControlBarCount(pBar);
if (iSizeControlBarCount == 0)
return;
// Add a tab for all other size control bars that are docked but not tabbed
int i = 0;
for (i = 0; i < m_pSizeDockBar->m_arrBars.GetSize(); i++)
{
COXSizeControlBar* pSizeBar = DYNAMIC_DOWNCAST(COXSizeControlBar, m_pSizeDockBar->GetDockedControlBar(i));
if (pSizeBar != NULL && pSizeBar != pBar && FindTab(pSizeBar) == -1)
{
CString strTextOther;
pSizeBar->GetWindowText(strTextOther);
TCITEM tciOther;
tciOther.mask = TCIF_TEXT | TCIF_PARAM;
tciOther.pszText = strTextOther.GetBuffer(strTextOther.GetLength());
tciOther.lParam = (LPARAM) pSizeBar;
//Check added for visibility so that hidden control
//bars don't get shown - Nish - Feb 15th 2005
if(pSizeBar->IsWindowVisible())
InsertItem(0, &tciOther);
}
}
// Insert this control bar to the tab control
CString strText;
pBar->GetWindowText(strText);
TCITEM tci;
tci.mask = TCIF_TEXT | TCIF_PARAM;
tci.pszText = strText.GetBuffer(strText.GetLength());
tci.lParam = (LPARAM) pBar;
InsertItem(iIndex, &tci);
SetCurSel(iIndex);
// Reshresh the tab control
m_pSizeDockBar->PositionTabCtrl();
if (bShowSelectedTab)
ShowSelectedTab();
else
{
int iSelected = GetCurSel();
for (i = 0; i < GetItemCount(); i++)
{
CControlBar* pBar = GetBar(i);
if (iSelected != i)
pBar->GetDockingFrame()->ShowControlBar(pBar, FALSE, TRUE); // hide
}
}
}
示例3: ShowAll
void CDockBar::ShowAll(BOOL bShow)
{
for (int nPos = 0; nPos < m_arrBars.GetSize(); nPos++)
{
CControlBar* pBar = (CControlBar*)m_arrBars[nPos];
if (pBar != NULL)
{
CFrameWnd* pFrameWnd = pBar->GetDockingFrame();
pFrameWnd->ShowControlBar(pBar, bShow, TRUE);
}
}
}