本文整理汇总了C++中CDockBar::GetDlgCtrlID方法的典型用法代码示例。如果您正苦于以下问题:C++ CDockBar::GetDlgCtrlID方法的具体用法?C++ CDockBar::GetDlgCtrlID怎么用?C++ CDockBar::GetDlgCtrlID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDockBar
的用法示例。
在下文中一共展示了CDockBar::GetDlgCtrlID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EndDrag
void CDockContext::EndDrag()
/**************************/
{
DrawFocusRect( TRUE );
if( m_dwOverDockStyle != 0L && !m_bForceFrame ) {
CDockBar *pDockBar = GetDockBar( m_dwOverDockStyle );
ASSERT( pDockBar != NULL );
if( ((m_dwOverDockStyle & CBRS_ORIENT_HORZ) && !m_bFlip) ||
((m_dwOverDockStyle & CBRS_ORIENT_VERT) && m_bFlip) ) {
pDockBar->DockControlBar( m_pBar, &m_rectDragHorz );
} else {
pDockBar->DockControlBar( m_pBar, &m_rectDragVert );
}
m_dwOverDockStyle = 0L;
m_uMRUDockID = pDockBar->GetDlgCtrlID();
m_pBar->GetWindowRect( &m_rectMRUDockPos );
} else {
ASSERT( m_pDockSite != NULL );
if( ((m_dwStyle & CBRS_ORIENT_HORZ) && !m_bFlip) ||
((m_dwStyle & CBRS_ORIENT_VERT) && m_bFlip) ) {
m_pDockSite->FloatControlBar( m_pBar, m_rectFrameDragHorz.TopLeft(),
CBRS_ALIGN_TOP | (m_dwDockStyle & CBRS_FLOAT_MULTI) );
m_ptMRUFloatPos = m_rectFrameDragHorz.TopLeft();
} else {
m_pDockSite->FloatControlBar( m_pBar, m_rectFrameDragVert.TopLeft(),
CBRS_ALIGN_LEFT | (m_dwDockStyle & CBRS_FLOAT_MULTI) );
m_ptMRUFloatPos = m_rectFrameDragVert.TopLeft();
}
}
delete m_pDC;
m_pDC = NULL;
m_bDragging = FALSE;
}
示例2: CanDock
DWORD CGuiDockContext::CanDock(CRect rect, DWORD dwDockStyle, CDockBar** ppDockBar)
{
// dwDockStyle -- allowable styles of bar
// don't allow to dock to floating unless multi is specified
BOOL bTipoToolBar=m_pBar->IsKindOf(RUNTIME_CLASS( CGuiToolBarWnd)) ||
m_pBar->IsKindOf(RUNTIME_CLASS( CMenuBar));
dwDockStyle &= CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI;
if (ppDockBar != NULL)
*ppDockBar = NULL;
POSITION pos = m_pDockSite->m_listControlBars.GetHeadPosition();
while (pos != NULL)
{
CDockBar* pDockBar = (CDockBar*)m_pDockSite->m_listControlBars.GetNext(pos);
if (pDockBar->IsDockBar() && pDockBar->IsWindowVisible() &&
(pDockBar->m_dwStyle & dwDockStyle & CBRS_ALIGN_ANY) &&
(!pDockBar->m_bFloating ||
(dwDockStyle & pDockBar->m_dwStyle & CBRS_FLOAT_MULTI)))
{
int nSize=pDockBar->m_arrBars.GetSize();
for (int i=0;i <nSize; i++)
{
UINT m_nDockBarID = pDockBar->GetDlgCtrlID();
CControlBar* pBar;
pBar = (CControlBar*) pDockBar->m_arrBars[i];
if (HIWORD(pBar) == 0) continue; // placeholder
if (!pBar->IsVisible()) continue;
CRect rectBar;
pBar->GetWindowRect(&rectBar);
if (rectBar.Width() == 0)
rectBar.right++;
if (rectBar.Height() == 0)
rectBar.bottom++;
CRect rectBar1;
pDockBar->GetWindowRect(&rectBar1);
if (dwDockStyle==CBRS_ORIENT_VERT)
{
if (m_nDockBarID==AFX_IDW_DOCKBAR_LEFT)
rectBar1.right=rectBar1.left+10;
if(m_nDockBarID==AFX_IDW_DOCKBAR_RIGHT)
rectBar1.left=rectBar1.right-10;
}
else
{
if (m_nDockBarID==AFX_IDW_DOCKBAR_BOTTOM)
rectBar1.top=rectBar1.bottom-10;
if (m_nDockBarID==AFX_IDW_DOCKBAR_TOP)
rectBar1.bottom=rectBar1.top+10;
}
if (rectBar1.IntersectRect(rectBar1, rect))
{
if (ppDockBar != NULL)
*ppDockBar = pDockBar;
return pDockBar->m_dwStyle & dwDockStyle;
}
//***********************************************
if (rectBar.IntersectRect(rectBar, rect))
{
if (bTipoToolBar)
{
if (pBar->IsKindOf(RUNTIME_CLASS( CGuiControlBar)))
return 0;
}
if (ppDockBar != NULL)
*ppDockBar = pDockBar;
return pDockBar->m_dwStyle & dwDockStyle;
}
}//fin del for
CRect rectBar;
pDockBar->GetWindowRect(&rectBar);
if (rectBar.Width() == 0)
rectBar.right++;
if (rectBar.Height() == 0)
rectBar.bottom++;
if (rectBar.IntersectRect(rectBar, rect))
{
if (ppDockBar != NULL)
*ppDockBar = pDockBar;
return pDockBar->m_dwStyle & dwDockStyle;
}
}
}
return 0;
}