本文整理汇总了C++中CControlBar::GetBarStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlBar::GetBarStyle方法的具体用法?C++ CControlBar::GetBarStyle怎么用?C++ CControlBar::GetBarStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlBar
的用法示例。
在下文中一共展示了CControlBar::GetBarStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanDock
DWORD CFrameWnd::CanDock( CRect rect, DWORD dwDockStyle, CDockBar **ppDockBar )
/*****************************************************************************/
{
POSITION position = m_listControlBars.GetHeadPosition();
while( position != NULL ) {
CControlBar *pControlBar = (CControlBar *)m_listControlBars.GetNext( position );
ASSERT( pControlBar != NULL );
if( pControlBar->IsDockBar() && (pControlBar->GetBarStyle() & dwDockStyle) ) {
CDockBar *pDockBar = (CDockBar *)pControlBar;
ASSERT( pDockBar->IsKindOf( RUNTIME_CLASS( CDockBar ) ) );
if( !pDockBar->m_bFloating ||
(pDockBar->GetBarStyle() & CBRS_FLOAT_MULTI) ) {
CRect rectBar;
pDockBar->GetWindowRect( &rectBar );
RECT rectJunk;
if( rectBar.left == rectBar.right ) {
rectBar.right++;
}
if( rectBar.top == rectBar.bottom ) {
rectBar.bottom++;
}
if( ::IntersectRect( &rectJunk, &rect, &rectBar ) ) {
if( ppDockBar != NULL ) {
*ppDockBar = pDockBar;
}
return( pDockBar->GetBarStyle() & dwDockStyle );
}
}
}
}
return( 0L );
}
示例2: OnShowControlBars
BOOL COleClientItem::OnShowControlBars(CFrameWnd* pFrameWnd, BOOL bShow)
{
ASSERT_VALID(pFrameWnd);
ASSERT_VALID(this);
// show/hide all bars marked with CBRS_HIDE_INPLACE style
BOOL bResult = FALSE;
if (bShow)
{
POSITION pos = pFrameWnd->m_listControlBars.GetHeadPosition();
while (pos)
{
CControlBar* pBar =
(CControlBar*)pFrameWnd->m_listControlBars.GetNext(pos);
ASSERT_VALID(pBar);
if ((pBar->GetBarStyle() & CBRS_HIDE_INPLACE) &&
(pBar->m_nStateFlags & CControlBar::tempHide))
{
pBar->m_nStateFlags &= ~CControlBar::tempHide;
pFrameWnd->ShowControlBar(pBar, TRUE, TRUE);
bResult = TRUE;
}
}
}
else
{
POSITION pos = pFrameWnd->m_listControlBars.GetHeadPosition();
while (pos)
{
CControlBar* pBar =
(CControlBar*)pFrameWnd->m_listControlBars.GetNext(pos);
ASSERT_VALID(pBar);
if (pBar->IsVisible() && (pBar->GetBarStyle() & CBRS_HIDE_INPLACE))
{
pBar->m_nStateFlags |= CControlBar::tempHide;
pFrameWnd->ShowControlBar(pBar, FALSE, TRUE);
bResult = TRUE;
}
}
}
return bResult;
}
示例3: dockControlBarBesideOf
void RDOEditorMainFrame::dockControlBarBesideOf( CControlBar& bar, CControlBar& baseBar )
{
RecalcLayout( TRUE );
CRect rect;
baseBar.GetWindowRect( rect );
DWORD dw = baseBar.GetBarStyle();
UINT n = 0;
n = ( dw & CBRS_ALIGN_TOP ) ? AFX_IDW_DOCKBAR_TOP : n;
n = ( dw & CBRS_ALIGN_BOTTOM && !n ) ? AFX_IDW_DOCKBAR_BOTTOM : n;
n = ( dw & CBRS_ALIGN_LEFT && !n ) ? AFX_IDW_DOCKBAR_LEFT : n;
n = ( dw & CBRS_ALIGN_RIGHT && !n ) ? AFX_IDW_DOCKBAR_RIGHT : n;
int dx = 0;
int dy = 0;
if ( n == AFX_IDW_DOCKBAR_TOP || n == AFX_IDW_DOCKBAR_BOTTOM ) dx = 1;
if ( n == AFX_IDW_DOCKBAR_LEFT || n == AFX_IDW_DOCKBAR_RIGHT ) dy = 1;
rect.OffsetRect( dx, dy );
DockControlBar( &bar, n, rect );
}