//--------------------------------------------------------------------------------------- void CBCGPAutoHideToolBar::OnLButtonDown(UINT nFlags, CPoint point) { CBCGPAutoHideButton* pBtn = CBCGPAutoHideToolBar::ButtonFromPoint (point); if (pBtn != NULL) { CBCGPDockingControlBar* pAttachedBar = pBtn->GetAutoHideWindow (); if (pAttachedBar != NULL) { BOOL bActivateOnClick = FALSE; CBCGPDockManager* pDockManager = globalUtils.GetDockManager (GetDockSite ()); if (pDockManager != NULL) { ASSERT_VALID (pDockManager); bActivateOnClick = pDockManager->IsActivateAutoHideBarOnMouseClick(); } if (bActivateOnClick) { pBtn->ShowAttachedWindow(!pAttachedBar->IsWindowVisible()); } pAttachedBar->SetFocus (); } } CBCGPControlBar::OnLButtonDown(nFlags, point); }
//********************************************************************************* BOOL CBCGPOutlookBar::Create(LPCTSTR lpszCaption, CWnd* pParentWnd, const RECT& rect, UINT nID, DWORD dwStyle, DWORD dwBCGStyle, CCreateContext* pContext) { BOOL bResult = CBCGPBaseTabbedBar::Create (lpszCaption, pParentWnd, rect, FALSE, nID, dwStyle, CBRS_BCGP_OUTLOOK_TABS, dwBCGStyle, pContext); if (!bResult) { TRACE0("Failed to create CBCGPOutlookBar\n"); return FALSE; } if (dwBCGStyle & CBRS_BCGP_RESIZE) { EnableDocking (CBRS_ALIGN_ANY); DockControlBarMap (FALSE); } else { CBCGPDockManager* pManager = globalUtils.GetDockManager (pParentWnd); if (pManager != NULL) { pManager->AddControlBar (this); } } if (lpszCaption != NULL) { m_strBarName = lpszCaption; } return TRUE; }
void CBCGPPrintPreviewToolBar::OnDestroy() { CFrameWnd* pParentFrame = BCGPGetParentFrame (this); ASSERT_VALID (pParentFrame); CBCGPDockManager* pDockManager = globalUtils.GetDockManager (pParentFrame); if (pDockManager != NULL) { pDockManager->RemoveControlBarFromDockManager (this, FALSE, FALSE, FALSE, NULL); } CBCGPToolBar::OnDestroy(); }
void CBCGPOleServerDoc::OnShowControlBars(CFrameWnd* pFrameWnd, BOOL bShow) { COleServerDoc::OnShowControlBars (pFrameWnd, bShow); CBCGPOleCntrFrameWnd* pMainFrame = DYNAMIC_DOWNCAST (CBCGPOleCntrFrameWnd, pFrameWnd); if (pMainFrame != NULL) { ASSERT_VALID (pMainFrame); CBCGPDockManager* pDockManager = pMainFrame->GetDockManager (); if (pDockManager != NULL) { ASSERT_VALID (pDockManager); pDockManager->ShowControlBars (bShow); } } }
void CBCGPOleServerDoc::OnDocWindowActivate( BOOL bActivate ) { if (bActivate) { COleServerDoc::OnDocWindowActivate (bActivate); return; } CBCGPOleCntrFrameWnd* pMainFrame = NULL; CBCGPOleDocIPFrameWnd* p_IpDocFrame = DYNAMIC_DOWNCAST (CBCGPOleDocIPFrameWnd, m_pInPlaceFrame); if (p_IpDocFrame != NULL) { pMainFrame = p_IpDocFrame->GetContainerFrameWindow (); } else { CBCGPOleIPFrameWnd* p_IpFrame = DYNAMIC_DOWNCAST (CBCGPOleIPFrameWnd, m_pInPlaceFrame); if (p_IpFrame != NULL) { pMainFrame = p_IpFrame->GetContainerFrameWindow (); } } if (pMainFrame == NULL) { return; } CBCGPDockManager* pDockManager = pMainFrame->GetDockManager (); ASSERT_VALID (pDockManager); pDockManager->ShowControlBars(bActivate); COleServerDoc::OnDocWindowActivate (bActivate); }
void CMainFrame::OnAppLook(UINT id) { CBCGPDockManager::SetDockMode(BCGP_DT_SMART); m_nAppLook = id; theApp.WriteInt(_T("ApplicationLook"), m_nAppLook); ChangeSkin(id); CBCGPDockManager* pDockManager = GetDockManager(); if (pDockManager != NULL) { ASSERT_VALID(pDockManager); pDockManager->AdjustBarFrames(); } RecalcLayout(); RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); CJXCMainDlg::AutoChangeSkin(); }
//************************************************************************************* void CBCGPFullScreenImpl::UnDockAndHideControlBars(CFrameWnd* pFrame) { CBCGPMDIFrameWnd* pbcgMDIFrame = DYNAMIC_DOWNCAST (CBCGPMDIFrameWnd, pFrame); CBCGPFrameWnd* pbcgFrame = DYNAMIC_DOWNCAST (CBCGPFrameWnd, pFrame); CBCGPDockManager* pDockMgr = m_pImpl->m_pDockManager; if (pDockMgr == NULL) { return; } CObList list; pDockMgr->GetControlBarList (list, TRUE); //------------------------------------ // UnDock and hide DockingControlBars //------------------------------------- POSITION pos; for (pos = list.GetHeadPosition (); pos != NULL;) { CBCGPBaseControlBar* pBarNext = (CBCGPBaseControlBar*) list.GetNext (pos); if (!::IsWindow(pBarNext->m_hWnd)) { continue; } CBCGPAutoHideDockBar* pAutoDockBar = DYNAMIC_DOWNCAST(CBCGPAutoHideDockBar, pBarNext); if (pAutoDockBar != NULL) { continue; } CBCGPAutoHideToolBar* pAutoToolBar = DYNAMIC_DOWNCAST(CBCGPAutoHideToolBar, pBarNext); if (pAutoToolBar != NULL) { continue; } CBCGPDockingControlBar* pBar = DYNAMIC_DOWNCAST(CBCGPDockingControlBar, pBarNext); if (pBar != NULL) { if (pBar->IsMDITabbed ()) { continue; } CBCGPTabbedControlBar* pTabbedBar = DYNAMIC_DOWNCAST(CBCGPTabbedControlBar, pBarNext); if (pTabbedBar != NULL) { if (ShouldProccessTabbedBar (pTabbedBar)) { ProccessTabbedBar (pTabbedBar); continue; } } if (!pBar->HideInFullScreenMode ()) { continue; } if (pBar->IsAutoHideMode ()) { pBar->SetAutoHideMode (FALSE, CBRS_ALIGN_ANY); } if (pBar->IsTabbed ()) { CBCGPBaseTabWnd* pTabWnd = (CBCGPBaseTabWnd*) pBar->GetParent (); CBCGPBaseTabbedBar* pTabBar = (CBCGPBaseTabbedBar*) pTabWnd->GetParent (); pTabBar->DetachControlBar (pBar); } if(pBar->CanFloat()) { pBar->FloatControlBar (CRect (300, 200, 500, 500), BCGP_DM_UNKNOWN, FALSE); } if (pbcgMDIFrame != NULL) { pbcgMDIFrame->ShowControlBar (pBar, FALSE,FALSE, FALSE); } else if (pbcgFrame != NULL) { pbcgFrame->ShowControlBar (pBar, FALSE,FALSE, FALSE); } }else { CBCGPControlBar* pControlBar = DYNAMIC_DOWNCAST (CBCGPControlBar, pBarNext); if (pControlBar != NULL) { if (pbcgMDIFrame != NULL) { pbcgMDIFrame->ShowControlBar (pControlBar, FALSE,FALSE, FALSE); } else if (pbcgFrame != NULL) { pbcgFrame->ShowControlBar (pControlBar, FALSE,FALSE, FALSE); } continue; } } } //------------------------------------ // UnDock and hide all Toolbars //------------------------------------- const CObList& gAllToolbars = CBCGPToolBar::GetAllToolbars (); for (pos = gAllToolbars.GetHeadPosition (); pos != NULL;) { CBCGPToolBar* pToolBar = (CBCGPToolBar*) gAllToolbars.GetNext (pos); ASSERT (pToolBar != NULL); if (CWnd::FromHandlePermanent (pToolBar->m_hWnd) != NULL) { ASSERT_VALID(pToolBar); if (pToolBar->GetParentFrame()->GetSafeHwnd() != pFrame->GetSafeHwnd()) { continue; } if (!pToolBar->HideInFullScreenMode ()) { continue; } //------------------------------ // Don't touch dropdown toolbars! //------------------------------ if (!pToolBar->IsKindOf (RUNTIME_CLASS (CBCGPDropDownToolBar))) { if (pToolBar->IsKindOf (RUNTIME_CLASS (CBCGPMenuBar))) { if(pToolBar->CanFloat ()) { pToolBar->FloatControlBar (CRect (0, -1024, 0, -1024)); if (pbcgMDIFrame != NULL) { pbcgMDIFrame->ShowControlBar (pToolBar, FALSE,FALSE, FALSE); } else if (pbcgFrame != NULL) { pbcgFrame->ShowControlBar (pToolBar, FALSE,FALSE, FALSE); } } continue; } //------------------------------------------------------ // Don't touch toolbars resids on the DockingControlBars //------------------------------------------------------ CWnd* pWnd = pToolBar->GetParent (); if (pWnd->IsKindOf (RUNTIME_CLASS (CBCGPDockBar)) || pWnd->IsKindOf (RUNTIME_CLASS (CBCGPMiniFrameWnd))) { if (pbcgMDIFrame != NULL) { if (pToolBar->CanFloat ()) { pToolBar->FloatControlBar (CRect (300, 200, 500, 500)); } pbcgMDIFrame->ShowControlBar (pToolBar, FALSE,FALSE, FALSE); } else if (pbcgFrame != NULL) { if (pToolBar->CanFloat ()) { pToolBar->FloatControlBar (CRect (300, 200, 500, 500)); } pbcgFrame->ShowControlBar (pToolBar, FALSE,FALSE, FALSE); } } } } } }
int CBCGPPrintPreviewView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CPreviewView::OnCreate(lpCreateStruct) == -1) { if (g_pPrintPreviewlocaRes != NULL) { delete g_pPrintPreviewlocaRes; g_pPrintPreviewlocaRes = NULL; } return -1; } g_pActivePrintPreview = this; ASSERT_VALID (m_pToolBar); CFrameWnd* pParentFrame = BCGPGetParentFrame (this); ASSERT_VALID (pParentFrame); CFrameWnd* pToplevelFrame = pParentFrame; if (pToplevelFrame->IsKindOf (RUNTIME_CLASS (CBCGPMDIChildWnd))) { pToplevelFrame = pToplevelFrame->GetTopLevelFrame (); } #ifndef BCGP_EXCLUDE_RIBBON m_pWndRibbonBar = DYNAMIC_DOWNCAST (CBCGPRibbonBar, pToplevelFrame->GetDlgItem (AFX_IDW_RIBBON_BAR)); if (m_pWndRibbonBar != NULL && m_pWndRibbonBar->IsVisible()) { m_pWndRibbonBar->SetPrintPreviewMode (); } else #endif { const UINT uiToolbarHotID = globalData.Is32BitIcons () ? IDR_BCGRES_PRINT_PREVIEW32 : 0; if (!m_wndToolBar.Create (m_pToolBar) || !m_wndToolBar.LoadToolBar( IDR_BCGRES_PRINT_PREVIEW, 0, 0, TRUE /* Locked */, 0, 0, uiToolbarHotID)) { TRACE0("Failed to create print preview toolbar\n"); return FALSE; // fail to create } m_wndToolBar.SetOwner (this); //------------------------------------------- // Remember One Page/Two pages image indexes: //------------------------------------------- m_iPagesBtnIndex = m_wndToolBar.CommandToIndex (AFX_ID_PREVIEW_NUMPAGE); ASSERT (m_iPagesBtnIndex >= 0); CBCGPToolbarButton* pButton= m_wndToolBar.GetButton (m_iPagesBtnIndex); ASSERT_VALID (pButton); m_iOnePageImageIndex = pButton->GetImage (); int iIndex = m_wndToolBar.CommandToIndex (ID_BCGRES_TWO_PAGES_DUMMY); ASSERT (iIndex >= 0); pButton= m_wndToolBar.GetButton (iIndex); ASSERT_VALID (pButton); m_iTwoPageImageIndex = pButton->GetImage (); //--------------------------------- // Remove dummy "Two pages" button: //--------------------------------- m_wndToolBar.RemoveButton (iIndex); //------------------------------------ // Set "Print" button to image + text: //------------------------------------ m_wndToolBar.SetToolBarBtnText (m_wndToolBar.CommandToIndex (AFX_ID_PREVIEW_PRINT)); //--------------------------------- // Set "Close" button to text only: //--------------------------------- m_wndToolBar.SetToolBarBtnText (m_wndToolBar.CommandToIndex (AFX_ID_PREVIEW_CLOSE), NULL, TRUE, FALSE); CBCGPDockManager* pDockManager = globalUtils.GetDockManager (pParentFrame); ASSERT_VALID (pDockManager); pDockManager->AddControlBar (&m_wndToolBar, FALSE); //------------------------- // Change the Toolbar size: //------------------------- if (!m_bScaleLargeImages && m_wndToolBar.m_bLargeIcons) { m_wndToolBar.m_sizeCurButtonLocked = m_wndToolBar.m_sizeButtonLocked; m_wndToolBar.m_sizeCurImageLocked = m_wndToolBar.m_sizeImageLocked; } SetToolbarSize (); } //------------------------------------------- // Set Application Status Bar to Simple Text: //------------------------------------------- m_pWndStatusBar = DYNAMIC_DOWNCAST (CBCGPStatusBar, pToplevelFrame->GetDlgItem (AFX_IDW_STATUS_BAR)); if (m_pWndStatusBar != NULL) { //------------------------------------- // Set Simple Pane Style to No Borders: //------------------------------------- m_pWndStatusBar->SetPaneText (iSimplePaneIndex, NULL); } if (g_pPrintPreviewlocaRes != NULL) { delete g_pPrintPreviewlocaRes; g_pPrintPreviewlocaRes = NULL; } return 0; }
void CMainFrame::OnAppLook(UINT id) { CBCGPDockManager::SetDockMode (BCGP_DT_SMART); m_nAppLook = id; CBCGPTabbedControlBar::m_StyleTabWnd = CBCGPTabWnd::STYLE_3D; switch (m_nAppLook) { case ID_VIEW_APPLOOK_2000: // enable Office 2000 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager)); break; case ID_VIEW_APPLOOK_XP: // enable Office XP look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerXP)); break; case ID_VIEW_APPLOOK_WIN_XP: // enable Windows XP look (in other OS Office XP look will be used): CBCGPWinXPVisualManager::m_b3DTabsXPTheme = TRUE; CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPWinXPVisualManager)); break; case ID_VIEW_APPLOOK_2003: // enable Office 2003 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2003)); CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_VS2005: // enable VS 2005 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2005)); CBCGPTabbedControlBar::m_StyleTabWnd = CBCGPTabWnd::STYLE_3D_ROUNDED; CBCGPVisualManager::GetInstance (); CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_VS2008: // enable VS 2008 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2008)); CBCGPVisualManager::GetInstance (); CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_2007_1: // enable Office 2007 look: CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_LunaBlue); CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007)); CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_2007_2: // enable Office 2007 look: CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_ObsidianBlack); CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007)); CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_2007_3: // enable Office 2007 look: CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_Aqua); CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007)); CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_2007_4: // enable Office 2007 look: CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_Silver); CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007)); CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; default: ASSERT (FALSE); } CBCGPDockManager* pDockManager = GetDockManager (); if (pDockManager != NULL) { ASSERT_VALID (pDockManager); pDockManager->AdjustBarFrames (); } CBCGPTabbedControlBar::ResetTabs (); RecalcLayout (); RedrawWindow (); theApp.WriteInt (_T("ApplicationLook"), m_nAppLook); }
void CMainFrame::OnAppLook(UINT id) { CBCGPDockManager::SetDockMode (BCGP_DT_SMART); m_nAppLook = id; CBCGPTabbedControlBar::m_StyleTabWnd = CBCGPTabWnd::STYLE_3D; CBCGPMDITabParams mdiTabParams; mdiTabParams.m_bTabIcons = TRUE; switch (m_nAppLook) { case ID_VIEW_APPLOOK_2000: // enable Office 2000 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager)); break; case ID_VIEW_APPLOOK_XP: // enable Office XP look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerXP)); break; case ID_VIEW_APPLOOK_WIN_XP: // enable Windows XP look (in other OS Office XP look will be used): CBCGPWinXPVisualManager::m_b3DTabsXPTheme = TRUE; CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPWinXPVisualManager)); break; case ID_VIEW_APPLOOK_2003: // enable Office 2003 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2003)); mdiTabParams.m_style = CBCGPTabWnd::STYLE_3D_VS2005; mdiTabParams.m_bAutoColor = TRUE; CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_2007: case ID_VIEW_APPLOOK_2007_1: case ID_VIEW_APPLOOK_2007_2: case ID_VIEW_APPLOOK_2007_3: // enable Office 2007 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007)); mdiTabParams.m_style = CBCGPTabWnd::STYLE_3D_VS2005; mdiTabParams.m_bAutoColor = TRUE; CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_2010_1: case ID_VIEW_APPLOOK_2010_2: case ID_VIEW_APPLOOK_2010_3: // enable Office 2010 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2010)); mdiTabParams.m_style = CBCGPTabWnd::STYLE_3D_VS2005; mdiTabParams.m_bAutoColor = TRUE; CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_WIN7: // enable Windows look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerScenic)); mdiTabParams.m_style = CBCGPTabWnd::STYLE_3D_VS2005; mdiTabParams.m_bAutoColor = TRUE; CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_VS2005: // enable VS 2005 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2005)); mdiTabParams.m_style = CBCGPTabWnd::STYLE_3D_VS2005; mdiTabParams.m_bDocumentMenu = TRUE; CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_VS2008: // enable VS 2008 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2008)); mdiTabParams.m_style = CBCGPTabWnd::STYLE_3D_VS2005; mdiTabParams.m_bDocumentMenu = TRUE; CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; case ID_VIEW_APPLOOK_VS2010: // enable VS 2010 look: CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2010)); mdiTabParams.m_bDocumentMenu = TRUE; CBCGPDockManager::SetDockMode (BCGP_DT_SMART); break; } EnableMDITabbedGroups (TRUE, mdiTabParams); CBCGPDockManager* pDockManager = GetDockManager (); if (pDockManager != NULL) { ASSERT_VALID (pDockManager); pDockManager->AdjustBarFrames (); } CBCGPTabbedControlBar::ResetTabs (); RecalcLayout (); RedrawWindow (NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME | RDW_ERASE); theApp.WriteInt (_T("ApplicationLook"), m_nAppLook); }
//-------------------------------------------------------------------------------// void CBCGPAutoHideToolBar::OnMouseMove(UINT /*nFlags*/, CPoint /*point*/) { CPoint pt; GetCursorPos (&pt); ScreenToClient (&pt); CBCGPAutoHideButton* pBtn = ButtonFromPoint (pt); if (!m_bTracked) { m_bTracked = TRUE; TRACKMOUSEEVENT trackmouseevent; trackmouseevent.cbSize = sizeof(trackmouseevent); trackmouseevent.dwFlags = TME_LEAVE; trackmouseevent.hwndTrack = GetSafeHwnd(); trackmouseevent.dwHoverTime = HOVER_DEFAULT; ::BCGPTrackMouse (&trackmouseevent); } if (pBtn != NULL && !m_bReadyToDisplayAHWnd) { CBCGPDockingControlBar* pAttachedBar = pBtn->GetAutoHideWindow (); ASSERT_VALID (pAttachedBar); if (!pAttachedBar->IsWindowVisible ()) { if (m_nDisplayAHWndTimerID != 0) { KillTimer (m_nDisplayAHWndTimerID); m_nDisplayAHWndTimerID = 0; } BOOL bStartAutoHide = TRUE; CBCGPDockManager* pDockManager = globalUtils.GetDockManager (GetDockSite ()); if (pDockManager != NULL) { ASSERT_VALID (pDockManager); bStartAutoHide = !pDockManager->IsActivateAutoHideBarOnMouseClick(); } if (bStartAutoHide) { m_bReadyToDisplayAHWnd = TRUE; m_nDisplayAHWndTimerID = SetTimer(BCGP_DISPLAY_AHWND_EVENT, m_nShowAHWndDelay, NULL); } } if (m_pHighlightedButton != NULL && m_pHighlightedButton != pBtn) { ASSERT_VALID (m_pHighlightedButton); m_pHighlightedButton->HighlightButton (FALSE); } if (pBtn != m_pHighlightedButton) { pBtn->HighlightButton (TRUE); m_pHighlightedButton = pBtn; UpdateWindow (); Invalidate (); } } }
///////////////////////////////////////////////////////////////////////////// // CBCGPOleServerDoc commands void CBCGPOleServerDoc::OnResizeBorder( LPCRECT lpRectBorder, LPOLEINPLACEUIWINDOW lpUIWindow, BOOL bFrame ) { ASSERT_VALID (this); ASSERT (lpUIWindow != NULL); if (!bFrame) { COleServerDoc::OnResizeBorder (lpRectBorder, lpUIWindow, bFrame); return; } CBCGPOleCntrFrameWnd* pMainFrame = NULL; CBCGPOleDocIPFrameWnd* p_IpDocFrame = DYNAMIC_DOWNCAST(CBCGPOleDocIPFrameWnd, m_pInPlaceFrame); if (p_IpDocFrame != NULL) { pMainFrame = p_IpDocFrame->GetContainerFrameWindow (); } else { CBCGPOleIPFrameWnd* p_IpFrame = DYNAMIC_DOWNCAST (CBCGPOleIPFrameWnd, m_pInPlaceFrame); if (p_IpFrame != NULL) { pMainFrame = p_IpFrame->GetContainerFrameWindow (); } else { return; } } if (pMainFrame == NULL) { return; } CBCGPDockManager* pDockManager = pMainFrame->GetDockManager (); ASSERT_VALID (pDockManager); CRect rcCurBorders; if (lpRectBorder == NULL) { if (lpUIWindow->GetBorder(&rcCurBorders) != S_OK) { lpUIWindow->SetBorderSpace (NULL); return; } } else { rcCurBorders = *lpRectBorder; } if (AfxGetThread()->m_pActiveWnd == m_pInPlaceFrame) OnShowControlBars(pMainFrame, TRUE); pDockManager->m_rectInPlace = rcCurBorders; pDockManager->AdjustDockingLayout (); CRect rectClient = pDockManager->GetClientAreaBounds (); CRect rectRequest ( abs (rectClient.left - rcCurBorders.left), abs (rectClient.top - rcCurBorders.top), abs (rectClient.right - rcCurBorders.right), abs (rectClient.bottom - rcCurBorders.bottom)); // v.8.6 removed -1 to make it work in Excel CRect rectTemp; rectTemp = rectRequest; if (!rectRequest.IsRectNull() || lpUIWindow->RequestBorderSpace(&rectTemp) == S_OK) { lpUIWindow->SetBorderSpace (&rectRequest); pDockManager->AdjustDockingLayout (); } else { OnShowControlBars (pMainFrame, FALSE); CRect rect (0,0,0,0); lpUIWindow->SetBorderSpace(&rect); } }