Ejemplo n.º 1
0
bool COutlookFrame::VerifyBarState(LPCTSTR lpszProfileName)
{
    CDockState state;
    state.LoadState(lpszProfileName);

    for (int i = 0; i < state.m_arrBarInfo.GetSize(); i++)
        {
            CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i];
            ASSERT(pInfo != NULL);
            int nDockedCount = (int) pInfo->m_arrBarID.GetSize();
            if (nDockedCount > 0)
                {
                    // dockbar
                    for (int j = 0; j < nDockedCount; j++)
                        {
                            UINT nID = (UINT) pInfo->m_arrBarID[j];
                            if (nID == 0)
                                continue; // row separator
                            if (nID > 0xFFFF)
                                nID &= 0xFFFF; // placeholder - get the ID
                            if (GetControlBar(nID) == NULL)
                                return false;
                        }
                }

            if (!pInfo->m_bFloating) // floating dockbars can be created later
                if (GetControlBar(pInfo->m_nBarID) == NULL)
                    return false; // invalid bar ID
        }

    return true;
}
Ejemplo n.º 2
0
void CFrameWnd::ReDockControlBar(CControlBar* pBar, CDockBar* pDockBar, LPCRECT lpRect)
{
	ASSERT(pBar != NULL);
	// make sure CControlBar::EnableDocking has been called
	ASSERT(pBar->m_pDockContext != NULL);

	if (pDockBar == NULL)
	{
		// Search for the place holder.

		// In case we don't find a place holder, find a bar with the correct alignment
		// and keep it in pPossibleBar.
		CDockBar* pPossibleBar = NULL;
		for (int i = 0; i < 4; i++)
		{
			CDockBar* pTempBar = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
			if (pTempBar != NULL)
			{
				// Is this the same bar we docked with before?
				if (pTempBar->FindBar((CControlBar*)_AfxGetDlgCtrlID(pBar->m_hWnd)) > 0)
				{
					pDockBar = pTempBar;
					break;
				}
			}

			if ((dwDockBarMap[i][1] & CBRS_ALIGN_ANY) ==
				(pBar->m_dwStyle & CBRS_ALIGN_ANY))
			{
				pPossibleBar = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
				ASSERT(pPossibleBar != NULL);
				// assert fails when initial CBRS_ of bar does not
				// match available docking sites, as set by EnableDocking()
			}
		}

		// Did we find the place holder?
		if (pDockBar == NULL)
			pDockBar = pPossibleBar;
	}
	ASSERT(pDockBar != NULL);
	ASSERT(m_listControlBars.Find(pBar) != NULL);
	ASSERT(pBar->m_pDockSite == this);
	// if this assertion occurred it is because the parent of pBar was not initially
	// this CFrameWnd when pBar's OnCreate was called
	// i.e. this control bar should have been created with a different parent initially

	pDockBar->ReDockControlBar(pBar, lpRect);
}
Ejemplo n.º 3
0
// dock bars will be created in the order specified by dwMRCDockBarMap
// this also controls which gets priority during layout
// this order can be changed by calling EnableDocking repetitively
// with the exact order of priority
//------------------------------------------------------------------------------
void CMRCFrameWndSizeDock::EnableDocking(DWORD dwDockStyle, CRuntimeClass *pFloatingClass)
// This is over-ridden primarily because we need to insert our own CDockBar class
// to handle the recalc layout, and this is the place they are created.
//------------------------------------------------------------------------------
{
	// must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
    ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);

    m_pFloatingFrameClass = pFloatingClass; // protected member
    for (int i = 0; i < 4; i++)
    {
    	if (dwMRCDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)          // protected
        {
        	CDockBar* pDock = (CDockBar*)GetControlBar(dwMRCDockBarMap[i][0]);
            if (pDock == NULL)
            	{
                	pDock = new CSizeDockBar;
                    if (!pDock->Create(this,
						               WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
                                              dwMRCDockBarMap[i][1], dwMRCDockBarMap[i][0]))
                    {
                    	AfxThrowResourceException();
                    }
                }
        }
    }
}
Ejemplo n.º 4
0
//------------------------------------------------------------------------
void CMRCFrameWndSizeDock::LoadSizeBarState(LPCTSTR pszProfileName)
//------------------------------------------------------------------------
{
	// check the registry version. If it doesn't match, delete the previous key and return
	// this prevents us trying to load registry info from a previous version. This means that
	// bar states will be restored, but dockbars, etc will not.
	if (AfxGetApp()->GetProfileInt(pszProfileName, REG_VERSION, 0) != REG_VERSION_NO)
	{
		WriteProfileString(pszProfileName, NULL, NULL);		// this deletes this key from the registry
		return;
	}
	CFrameWnd::LoadBarState(pszProfileName);
#ifdef _VERBOSE_TRACE
	TRACE("Loading Bar Sizes\n");
#endif
	SaveBarSizes(pszProfileName, FALSE);		// load the sizes back 

	// Clear the dockbars' hidden lists to prevent interference with recalc layout
	for (int i = 0; i < 4; i++)
	{
		CSizeDockBar* pDock = (CSizeDockBar*)GetControlBar(dwMRCDockBarMap[i][0]);
		if (pDock != NULL)
		{
			ASSERT(pDock->IsKindOf(RUNTIME_CLASS(CSizeDockBar)));
			pDock->m_arrHiddenBars.RemoveAll();
		}
	}

}
Ejemplo n.º 5
0
LONG CMainFrame::OnNameOutput(UINT wParam, LONG lParam)
{
    int wnd = (int)wParam;
    HGLOBAL hg = (HGLOBAL)lParam;

    char* p = (char*)GlobalLock(hg);
    CString cs;
    if (p && p[0]) {
        cs = p;
    } else {
        CString t;
        t.LoadString(IDS_OUTPUT);
        cs.Format(t, wnd);
    }
    if (wnd >=0 && wnd < MAX_OUTPUT)
	{
        m_coolBar[wnd].SetTitle(cs);
		//* en
		if(m_coolBar[wnd].IsFloating())
		{
			CControlBar * pBar = GetControlBar(outputwindows[wnd]);
			FloatControlBar(pBar, CPoint(m_coolBar[wnd].m_mX,m_coolBar[wnd].m_mY),0);
		}
		//*/en
	}

    GlobalUnlock(hg);
    GlobalFree(hg);

    return 0;
}
Ejemplo n.º 6
0
void CFrameWnd::DockControlBar(CControlBar* pBar, CDockBar* pDockBar, LPCRECT lpRect)
{
	ASSERT(pBar != NULL);
	// make sure CControlBar::EnableDocking has been called
	ASSERT(pBar->m_pDockContext != NULL);

	if (pDockBar == NULL)
	{
		for (int i = 0; i < 4; i++)
		{
			if ((dwDockBarMap[i][1] & CBRS_ALIGN_ANY) ==
				(pBar->m_dwStyle & CBRS_ALIGN_ANY))
			{
				pDockBar = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
				ASSERT(pDockBar != NULL);
				// assert fails when initial CBRS_ of bar does not
				// match available docking sites, as set by EnableDocking()
				break;
			}
		}
	}
	ASSERT(pDockBar != NULL);
	ASSERT(m_listControlBars.Find(pBar) != NULL);
	ASSERT(pBar->m_pDockSite == this);
	// if this assertion occurred it is because the parent of pBar was not initially
	// this CFrameWnd when pBar's OnCreate was called
	// i.e. this control bar should have been created with a different parent initially

	pDockBar->DockControlBar(pBar, lpRect);
}
Ejemplo n.º 7
0
BOOL CMainFrame::OnBarCheckEx(UINT nID)
{
    int count = m_wndSplitter.GetRowCount ();
    for ( int i = 0 ; i < count ; i++ ) {
        (m_wndSplitter.GetPane(i, 0))->InvalidateRect(NULL);
    }

//vls-begin// multiple output
    CControlBar* pBar = GetControlBar(nID);

    if (pBar != NULL) {
        BOOL bVisible = (pBar->GetStyle() & WS_VISIBLE);
        for (int i = 0; i < MAX_OUTPUT; i++) {
            if (nID == outputwindows[i]) {
                m_coolBar[i].m_bFlag = !bVisible;
                break;
            }
        }
    }


//vls-end//

    return OnBarCheck(nID);
}
Ejemplo n.º 8
0
BOOL CFrameWnd::OnBarCheck( UINT nID )
/************************************/
{
    CControlBar *pBar = GetControlBar( nID );
    if( pBar == NULL ) {
        return( FALSE );
    }
    ShowControlBar( pBar, !pBar->IsWindowVisible(), FALSE );
    return( TRUE );
}
Ejemplo n.º 9
0
CExtControlBar * CExtMiniDockFrameWnd::GetControlBarExt()
{
CControlBar * pTempWnd = GetControlBar();
    if( pTempWnd == NULL )
        return NULL;
//	ASSERT_KINDOF( CExtControlBar, pTempWnd );
    if( !pTempWnd->IsKindOf( RUNTIME_CLASS(CExtControlBar) ) )
        return NULL;
    return reinterpret_cast < CExtControlBar * >( pTempWnd );
}
Ejemplo n.º 10
0
void CMainFrame::OnUpdateFcToolBarMenu(CCmdUI* pCmdUI) 
{
	CControlBar* pBar = GetControlBar(IDR_FORMAT);
	if (pBar != NULL)
	{
		pCmdUI->SetCheck((pBar->GetStyle() & WS_VISIBLE) != 0);
		return;
	}
	pCmdUI->ContinueRouting();
}
Ejemplo n.º 11
0
void CFrameWnd::OnUpdateControlBarMenu( CCmdUI *pCmdUI )
/******************************************************/
{
    CControlBar *pBar = GetControlBar( pCmdUI->m_nID );
    if( pBar != NULL ) {
        pCmdUI->SetCheck( pBar->IsWindowVisible() ? 1 : 0 );
    } else {
        pCmdUI->ContinueRouting();
    }
}
Ejemplo n.º 12
0
BOOL COleIPFrameWnd::OnBarCheck(UINT nID)
{
	if (GetControlBar(nID) != NULL)
		return CFrameWnd::OnBarCheck(nID);
	else if (m_pMainFrame != NULL && m_pMainFrame->GetControlBar(nID) != NULL)
		return m_pMainFrame->OnBarCheck(nID);
	else if (m_pDocFrame != NULL && m_pDocFrame->GetControlBar(nID) != NULL)
		return m_pDocFrame->OnBarCheck(nID);
	return FALSE;
}
Ejemplo n.º 13
0
BOOL CMainFrame::OnToggleFcToolBar(UINT nID) 
{
	CControlBar* pBar = GetControlBar(IDR_FORMAT);
	if (pBar != NULL)
	{
		ShowControlBar(pBar, (pBar->GetStyle() & WS_VISIBLE) == 0, FALSE);
		return TRUE;
	}
	return FALSE;
}
//*************************************************************************************
void CBCGPOleDocIPFrameWnd::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
	CBCGPBaseControlBar* pBar = GetControlBar(pCmdUI->m_nID);
	if (pBar != NULL)
	{
		pCmdUI->SetCheck((pBar->GetStyle() & WS_VISIBLE) != 0);
		return;
	}

	pCmdUI->ContinueRouting();
}
//*************************************************************************************
BOOL CBCGPOleDocIPFrameWnd::OnBarCheck(UINT nID)
{
	ASSERT_VALID (this);

	CBCGPBaseControlBar* pBar = GetControlBar(nID);
	if (pBar != NULL)
	{
		ShowControlBar(pBar, (pBar->GetStyle() & WS_VISIBLE) == 0, FALSE, FALSE);
		return TRUE;
	}

	return FALSE;
}
Ejemplo n.º 16
0
//vls-begin// multiple output
LONG CMainFrame::OnShowOutput(UINT wParam, LONG lParam)
{
    int wnd = (int)wParam;
    int opt = (int)lParam;
    UINT nId = outputwindows[wnd];
    CControlBar* pBar = GetControlBar(nId);

    if (pBar != NULL && opt > 0) {
        BOOL bVisible = (pBar->GetStyle() & WS_VISIBLE);
        if ( (opt>1 && bVisible) || (opt==1 && !bVisible) )
            return 0;
    }
    return SendMessage(WM_COMMAND, nId, 0);
}
Ejemplo n.º 17
0
void CMainFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
	ASSERT(ID_VIEW_STATUS_BAR == AFX_IDW_STATUS_BAR);
	ASSERT(ID_VIEW_TOOLBAR == AFX_IDW_TOOLBAR);
	ASSERT(ID_VIEW_REBAR == AFX_IDW_REBAR);

	CControlBar* pBar = GetControlBar(pCmdUI->m_nID);
	if (pBar != NULL)
	{
		pCmdUI->SetCheck((pBar->GetStyle() & WS_VISIBLE) != 0);
		return;
	}
	pCmdUI->ContinueRouting();
}
Ejemplo n.º 18
0
BOOL CMainFrame::OnBarCheck(UINT nID)
{
	ASSERT(ID_VIEW_STATUS_BAR == AFX_IDW_STATUS_BAR);
	ASSERT(ID_VIEW_TOOLBAR == AFX_IDW_TOOLBAR);
	ASSERT(ID_VIEW_REBAR == AFX_IDW_REBAR);

	CControlBar* pBar = GetControlBar(nID);
	if (pBar != NULL)
	{
		ShowControlBar(pBar, (pBar->GetStyle() & WS_VISIBLE) == 0, FALSE);
		return TRUE;
	}
	return FALSE;
}
Ejemplo n.º 19
0
void CExtMiniDockFrameWnd::OnNcLButtonUp(UINT nHitTest, CPoint point)
{
	if( _ResizingIsInProgress() )
	{
		_ResizingEnd();
		return;
	}
	
	if( CExtControlBar::_DraggingGetBar() != NULL )
		return;

CRect rcBarWnd;
	GetWindowRect( &rcBarWnd );
CPoint ptDevOffset = -rcBarWnd.TopLeft();
CPoint ptWnd( point + ptDevOffset );

CExtControlBar * pExtBar = GetControlBarExt();
	if( pExtBar != NULL && pExtBar->m_bNcAreaBtnTracking )
	{
		INT nCountOfNcButtons = pExtBar->NcButtons_GetCount();
		for( INT nBtn = 0; nBtn < nCountOfNcButtons; nBtn++ )
		{
			CExtBarNcAreaButton * pBtn =
				pExtBar->NcButtons_GetAt( nBtn );
			if( !pBtn->OnQueryVisibility() )
				continue;
			if( pBtn->OnNcAreaClicked( ptWnd ) )
				return;
		} // for( INT nBtn = 0; nBtn < nCountOfNcButtons; nBtn++ )
		return;
	} // if( pExtBar != NULL && pExtBar->m_bNcAreaBtnTracking )

	if( m_rcBtnHideBar.PtInRect( ptWnd ) )
	{
		CControlBar * pBar =
			GetControlBar();
		if( pBar == NULL )
			return;
		ASSERT_VALID( pBar );
		GetParentFrame()->
			ShowControlBar(
				pBar,
				FALSE,
				FALSE
				);
		return;
	}

	CMiniDockFrameWnd::OnNcLButtonUp(nHitTest, point);
}
Ejemplo n.º 20
0
void CFrameWnd::EnableDocking( DWORD dwDockStyle )
/************************************************/
{
    for( int i = 0; i < NUM_DOCKBARS; i++ ) {
        DWORD dwBarDockStyle = _DockBarInfo[i][1];
        if( dwDockStyle & dwBarDockStyle ) {
            CDockBar *pDockBar = (CDockBar *)GetControlBar( _DockBarInfo[i][1] );
            if( pDockBar == NULL ) {
                pDockBar = new CDockBar;
                pDockBar->Create( this, WS_CHILD | WS_VISIBLE | _DockBarInfo[i][1],
                                  _DockBarInfo[i][0] );
            }
        }
    }
}
Ejemplo n.º 21
0
void COleIPFrameWnd::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
	if (GetControlBar(pCmdUI->m_nID) != NULL)
		CFrameWnd::OnUpdateControlBarMenu(pCmdUI);
	else if (m_pMainFrame != NULL &&
		m_pMainFrame->GetControlBar(pCmdUI->m_nID) != NULL)
	{
		m_pMainFrame->OnUpdateControlBarMenu(pCmdUI);
	}
	else if (m_pDocFrame != NULL &&
		m_pDocFrame->GetControlBar(pCmdUI->m_nID) != NULL)
	{
		m_pDocFrame->OnUpdateControlBarMenu(pCmdUI);
	}
	else
		pCmdUI->ContinueRouting();
}
Ejemplo n.º 22
0
//-----------------------------------------------------------------------------
void CMRCFrameWndSizeDock::TileDockedBars(DWORD dwDockStyle)
// Tiles the bars docked in the specified orientation
//-----------------------------------------------------------------------------
{
	for (int i = 0; i < 4; i++)
    {
    	if (dwMRCDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)  //protected
        {
        	CSizeDockBar* pDock = (CSizeDockBar*)GetControlBar(dwMRCDockBarMap[i][0]);
            // ASSERT(pDock == NULL || pDock->IsKindOf(RUNTIME_CLASS(CSizeDockBar)));
            if (pDock != NULL && (pDock->m_dwStyle & dwDockStyle))
            {
            	pDock->TileDockedBars();
            }
        }
   	}
}
Ejemplo n.º 23
0
void CFrameWnd::DockControlBar( CControlBar *pBar, UINT nDockBarID, LPCRECT lpRect )
/**********************************************************************************/
{
    CDockBar *pDockBar = NULL;
    if( nDockBarID != 0 ) {
         pDockBar = (CDockBar *)GetControlBar( nDockBarID );
         if( pDockBar == NULL ) {
             // We're trying to dock to a dock bar that doesn't exist, so just don't do
             // anything.
             return;
         }
         if( !(pBar->m_dwDockStyle & (pDockBar->m_dwStyle & CBRS_ALIGN_ANY)) ) {
             // We don't support docking to a bar of this style, so just don't do
             // anything.
             return;
         }
         ASSERT( pDockBar->IsKindOf( RUNTIME_CLASS( CDockBar ) ) );
         if( lpRect != NULL ) {
            RECT    rectJunk;
            CRect   rectBar;
            pDockBar->GetWindowRect( &rectBar );
            if( rectBar.left == rectBar.right ) {
                rectBar.left--;
                rectBar.right++;
            }
            if( rectBar.top == rectBar.bottom ) {
                rectBar.top--;
                rectBar.bottom++;
            }
            if( !::IntersectRect( &rectJunk, &rectBar, lpRect ) ) {
                // The rectangle and the dock bar identifier don't coincide, so just
                // don't do anything.
                return;
            }
        }
    } else if( lpRect != NULL ){
        CanDock( *lpRect, pBar->m_dwDockStyle, &pDockBar );
    } else {
        CanDock( CRect( 0, 0, 32767, 32767 ), pBar->m_dwDockStyle, &pDockBar );
    }
    if( pDockBar != NULL ) {
        ASSERT( pDockBar->IsKindOf( RUNTIME_CLASS( CDockBar ) ) );
        pDockBar->DockControlBar( pBar, lpRect );
    }
}
Ejemplo n.º 24
0
LONG CMainFrame::OnPosWOutput(UINT wParam, LONG lParam)
{
    int p1,p2;
    int wnd = (int)wParam;

	p1 = lParam & 32767;
	p2 = lParam>>16;
    UINT nId = outputwindows[wnd];
    CControlBar* pBar = GetControlBar(nId);

    if ((pBar != NULL) && (m_coolBar[wnd])) {
        FloatControlBar(pBar,CPoint(p1,p2),0);
		m_coolBar[wnd].m_mX = p1;
		m_coolBar[wnd].m_mY = p2;
    }
  
    return 0;
}
Ejemplo n.º 25
0
BOOL CMainFrame::OnBarCheck(UINT nID)
{
BOOL bCheck = CFrameWnd::OnBarCheck (nID);
CControlBar* pBar = GetControlBar (nID);
m_bShowCtrlBar = pBar && ((pBar->GetStyle () & WS_VISIBLE) != 0);
#if EDITBAR
m_editBar.ShowWindow ((m_bShowCtrlBar && m_bEditorTB) ? SW_SHOW : SW_HIDE);
#endif
if (m_bShowCtrlBar) {
	if (m_bRecalcBarLayout)
	RecalcLayout (1);
	if (!CreateToolBars ())
		FixToolBars ();
	}
else {
	CRect rc;
	m_splitter2.GetPane (1,0)->GetWindowRect (rc);
	m_bRecalcBarLayout = (theApp.ToolSize ().cy == rc.Height () + 10);
	}
return bCheck;
}
Ejemplo n.º 26
0
/**
 * @brief We must use this function before a call to SetDockState
 *
 * @note Without this, SetDockState will assert or crash if a bar from the 
 * CDockState is missing in the current CMergeEditFrame.
 * The bars are identified with their ID. This means the missing bar bug is triggered
 * when we run WinMerge after changing the ID of a bar. 
 */
bool CMergeEditFrame::EnsureValidDockState(CDockState& state) 
{
	for (int i = (int) state.m_arrBarInfo.GetSize()-1 ; i >= 0; i--) 
	{
		bool barIsCorrect = true;
		CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i];
		if (pInfo == nullptr) 
			barIsCorrect = false;
		else
		{
			if (! pInfo->m_bFloating) 
			{
				pInfo->m_pBar = GetControlBar(pInfo->m_nBarID);
				if (pInfo->m_pBar == nullptr) 
					barIsCorrect = false; //toolbar id's probably changed	
			}
		}

		if (! barIsCorrect)
			state.m_arrBarInfo.RemoveAt(i);
	}
	return true;
}
Ejemplo n.º 27
0
/**
 * @brief We must use this function before a call to SetDockState
 *
 * @note Without this, SetDockState will assert or crash if a bar from the 
 * CDockState is missing in the current CChildFrame.
 * The bars are identified with their ID. This means the missing bar bug is triggered
 * when we run WinMerge after changing the ID of a bar. 
 */
BOOL CChildFrame::EnsureValidDockState(CDockState& state) 
{
	for (int i = (int) state.m_arrBarInfo.GetSize()-1 ; i >= 0; i--) 
	{
		BOOL barIsCorrect = TRUE;
		CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i];
		if (! pInfo) 
			barIsCorrect = FALSE;
		else
		{
			if (! pInfo->m_bFloating) 
			{
				pInfo->m_pBar = GetControlBar(pInfo->m_nBarID);
				if (!pInfo->m_pBar) 
					barIsCorrect = FALSE; //toolbar id's probably changed	
			}
		}

		if (! barIsCorrect)
			state.m_arrBarInfo.RemoveAt(i);
	}
	return TRUE;
}
Ejemplo n.º 28
0
int CExtMiniDockFrameWnd::OnToolHitTest(
	CPoint point,
	TOOLINFO * pTI
	) const
{
	ASSERT_VALID( this );
	
	if( pTI == NULL || m_wndToolTip.GetSafeHwnd() == NULL )
		return -1;

const CControlBar * pBar = GetControlBar();
	if( pBar == NULL )
		return -1;
	ASSERT_VALID( pBar );
	if( (pBar->m_dwStyle & CBRS_TOOLTIPS) == NULL )
		return -1;

int nRet = pBar->OnToolHitTest( point, pTI );
	if( nRet < 0 )
		return -1;

	if( pTI->lpszText != NULL )
	{
		CExtMiniDockFrameWnd * pNCT = (CExtMiniDockFrameWnd *)this;
		VERIFY(
			pNCT->m_wndToolTip.AddTool(
				pNCT,
				pTI->lpszText,
				&pTI->rect,
				1
				)
			);
	}
	
	return -1;
}
Ejemplo n.º 29
0
// dock bars will be created in the order specified by dwDockBarMap
// this also controls which gets priority during layout
// this order can be changed by calling EnableDocking repetitively
// with the exact order of priority
void CFrameWnd::EnableDocking(DWORD dwDockStyle)
{
	// must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
	ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);

	m_pFloatingFrameClass = RUNTIME_CLASS(CMiniDockFrameWnd);
	for (int i = 0; i < 4; i++)
	{
		if (dwDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)
		{
			CDockBar* pDock = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
			if (pDock == NULL)
			{
				pDock = new CDockBar;
				if (!pDock->Create(this,
					WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
						dwDockBarMap[i][1], dwDockBarMap[i][0]))
				{
					AfxThrowResourceException();
				}
			}
		}
	}
}
Ejemplo n.º 30
0
void CFrameWnd::DockControlBar(CControlBar* pBar, UINT nDockBarID, LPCRECT lpRect)
{
	CDockBar* pDockBar = (nDockBarID == 0) ? NULL :
		(CDockBar*)GetControlBar(nDockBarID);
	DockControlBar(pBar, pDockBar, lpRect);
}