本文整理汇总了C++中CControlBar::IsDockBar方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlBar::IsDockBar方法的具体用法?C++ CControlBar::IsDockBar怎么用?C++ CControlBar::IsDockBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlBar
的用法示例。
在下文中一共展示了CControlBar::IsDockBar方法的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: GetFloatingBars
//-----------------------------------------------------------------
void CMRCFrameWndSizeDock::GetFloatingBars(CObArray & arrWnd)
// Appends the floating bars, visible bars to an array
//-----------------------------------------------------------------
{
CPtrList & listControlBars = m_listControlBars;
POSITION pos = listControlBars.GetHeadPosition();
while (pos != NULL)
{
CControlBar* pBar = (CControlBar*)listControlBars.GetNext(pos);
ASSERT(pBar != NULL);
if (!pBar->IsDockBar() && pBar->IsFloating() && pBar->IsVisible()) // not a dockbar and floating....
{
ASSERT(pBar->m_pDockBar != NULL);
CWnd * pFloatFrame = ((CWnd *)pBar->m_pDockBar)->GetParent();
ASSERT(pBar != NULL);
arrWnd.Add(pFloatFrame);
}
}
}
示例3: OnSetPreviewMode
void CFrameWnd::OnSetPreviewMode( BOOL bPreview, CPrintPreviewState *pState )
/***************************************************************************/
{
ASSERT( pState != NULL );
DWORD dwSaveStates = 0L;
POSITION position = m_listControlBars.GetHeadPosition();
while( position != NULL ) {
CControlBar *pBar = (CControlBar *)m_listControlBars.GetNext( position );
ASSERT( pBar != NULL );
ASSERT( pBar->IsKindOf( RUNTIME_CLASS( CControlBar ) ) );
DWORD dwID = pBar->GetDlgCtrlID();
if( dwID >= AFX_IDW_CONTROLBAR_FIRST && dwID < AFX_IDW_CONTROLBAR_FIRST + 32 ) {
DWORD dwThisState = AFX_CONTROLBAR_MASK( dwID );
if( pBar->IsWindowVisible() ) {
dwSaveStates |= dwThisState;
}
if( !(pBar->IsDockBar() && pBar->GetDlgCtrlID() == AFX_IDW_DOCKBAR_FLOAT) ) {
ShowControlBar( pBar, pState->dwStates & dwThisState, TRUE );
}
}
}
pState->dwStates = dwSaveStates;
if( bPreview ) {
m_lpfnCloseProc = pState->lpfnCloseProc;
pState->hMenu = ::GetMenu( m_hWnd );
::SetMenu( m_hWnd, NULL );
pState->hAccelTable = m_hAccelTable;
m_hAccelTable = NULL;
LoadAccelTable( MAKEINTRESOURCE( AFX_IDR_PREVIEW_ACCEL ) );
HWND hWndPane = ::GetDlgItem( m_hWnd, pState->nIDMainPane );
if( hWndPane != NULL ) {
::ShowWindow( hWndPane, SW_HIDE );
}
hWndPane = ::GetDlgItem( m_hWnd, AFX_IDW_PANE_FIRST );
if( hWndPane != NULL ) {
::SetWindowLong( hWndPane, GWL_ID, AFX_IDW_PANE_SAVE );
}
} else {
m_lpfnCloseProc = NULL;
if( pState->hMenu != NULL ) {
::SetMenu( m_hWnd, pState->hMenu );
pState->hMenu = NULL;
}
if( pState->hAccelTable != NULL ) {
m_hAccelTable = pState->hAccelTable;
pState->hAccelTable = NULL;
}
HWND hWndPane = ::GetDlgItem( m_hWnd, AFX_IDW_PANE_SAVE );
if( hWndPane != NULL ) {
::SetWindowLong( hWndPane, GWL_ID, AFX_IDW_PANE_FIRST );
}
hWndPane = ::GetDlgItem( m_hWnd, pState->nIDMainPane );
if( hWndPane != NULL ) {
::ShowWindow( hWndPane, SW_SHOW );
}
}
}