void CSizingDialog::ResizeControls() { // XR: size of the dialog moving CRect rcDlg; this->GetWindowRect(&rcDlg); int dx = rcDlg.Width() - m_rcInit.Width(); int dy = rcDlg.Height() - m_rcInit.Height(); // XR: move the controls POSITION pos = m_mapPtToInfo.GetStartPosition(); while (pos != NULL) { HWND hCtrl; CCtrlInfo* pInfo; m_mapPtToInfo.GetNextAssoc(pos, (void *&)hCtrl, (void *&)pInfo); TRACE("this: 0x%xd\n", this); TRACE("0x%xd\n", ::GetDlgItem(m_hWnd, IDCANCEL)); TRACE("0x%xd\n", ::GetDlgItem(m_hWnd, IDOK)); TRACE("0x%xd\n", hCtrl); ASSERT(::IsWindow(hCtrl)); ASSERT(::IsChild(this->m_hWnd, hCtrl)); CWnd* pCtrl = FromHandle(hCtrl); if (::IsGroupBox(pCtrl)) { ::ResizeGroupBox(pCtrl, this, pInfo, dx, dy); continue; } CRect rcCtrlOld; pCtrl->GetWindowRect(&rcCtrlOld); this->ScreenToClient(&rcCtrlOld); CRect rcCtrl = pInfo->m_rcInit; rcCtrl.left += LONG(dx*pInfo->m_dRateLeft); rcCtrl.right += LONG(dx*pInfo->m_dRateRight); rcCtrl.top += LONG(dy*pInfo->m_dRateTop); rcCtrl.bottom += LONG(dy*pInfo->m_dRateBottom); // BOOL bVisible = ::IsWindowVisible(pCtrl->m_hWnd); pCtrl->SetRedraw(FALSE); pCtrl->MoveWindow(&rcCtrl); // if (!bVisible) // continue; pCtrl->SetRedraw(TRUE); this->InvalidateCtrlBorder(&rcCtrlOld, &rcCtrl); pCtrl->InvalidateRect(NULL); } }
//------------------------------------------------------------------------// void CBCGPGlobalUtils::ForceAdjustLayout (CBCGPDockManager* pDockManager, BOOL bForce, BOOL bForceInvisible, BOOL bForceNcArea) { if (pDockManager != NULL && (CBCGPControlBar::m_bHandleMinSize || bForce)) { CWnd* pDockSite = pDockManager->GetDockSite (); if (pDockSite == NULL) { return; } if (!pDockSite->IsWindowVisible () && !bForceInvisible) { return; } if (pDockSite->IsKindOf(RUNTIME_CLASS(CBCGPFrameWnd)) || pDockSite->IsKindOf(RUNTIME_CLASS(CBCGPMDIFrameWnd))) { m_bIsAdjustLayout = (pDockSite->GetStyle() & WS_MAXIMIZE) == WS_MAXIMIZE; } CRect rectWnd; pDockSite->SetRedraw (FALSE); pDockSite->GetWindowRect (rectWnd); pDockSite->SetWindowPos (NULL, -1, -1, rectWnd.Width () + 1, rectWnd.Height () + 1, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); pDockSite->SetWindowPos (NULL, -1, -1, rectWnd.Width (), rectWnd.Height (), SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); pDockSite->SetRedraw (TRUE); if (bForceNcArea) { pDockSite->SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } m_bIsAdjustLayout = FALSE; pDockSite->RedrawWindow (NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN); } }
void CTreeCtrlFolder::Display(CRect rc) { SetWindowPos(&wndNoTopMost, rc.left, rc.top, rc.Width (), rc.Height (), SWP_SHOWWINDOW); CWnd* pTopParent = GetParent()->GetParentOwner(); if (pTopParent != NULL) { pTopParent->SendMessage( WM_NCACTIVATE, TRUE ); pTopParent->SetRedraw( TRUE ); } }
void ETSOuterSplitter::CloseSplitter() { CWnd *pWnd = (CWnd*)this->GetParent(); pWnd->SetRedraw(false); //int min = m_pane->GetOuterPaneMinPosition(); //m_nMinConstrainHorz = (min == 0) ? m_nMinConstrainHorz : min; if(!m_pane->IsClosed()) { m_pane->setOpenConstrain(); int step = m_pane->m_nSplOpendPos / CLOSE_STEP; //TRACE("dd%d\n", step); int offset = 0; if(m_pane->m_nClosedOri == 0) offset = m_pane->getCloseConstrain(-step); else offset = m_pane->getCloseConstrain(step); if(abs(offset) <= step) { m_pane->SetClosed(true); m_pane->resizeTo(offset, true); } else m_pane->resizeTo(offset); //// LoadSkin(m_pSkin); pWnd->SetRedraw(true); CRect r; pWnd->GetWindowRect(&r); r.right -= offset; pWnd->SetWindowPos(NULL, r.left, r.top , r.Width(), r.Height(), NULL); ::AfxGetUIManager()->UIGetLayoutMgr()->UpdateLayout(::AfxGetMainWindow()->m_hWnd); //m_rootPanel->UpdateLayout(this->GetParent()->m_hWnd); m_nMouseOffset = 0; } else { int offset = 0; int step = m_pane->m_nSplOpendPos / CLOSE_STEP; if(step == 0) step = m_pane->GetOuterPaneMinPosition(); if(m_pane->m_nClosedOri == 0) offset = m_pane->getOpenConstrain(step); else offset = m_pane->getOpenConstrain(-step); if(abs(offset) <= step) { m_pane->SetClosed(false); m_pane->resizeTo(offset, true); } else m_pane->resizeTo(offset); //// LoadSkin(this->m_pSkin); pWnd->SetRedraw(true); m_nMouseOffset = 0; CRect r; pWnd->GetWindowRect(&r); r.right -= offset; pWnd->SetWindowPos(NULL, r.left, r.top , r.Width(), r.Height(), NULL); } }