void CRectItem::Move(CRect &rc) { // invalidate old rect Invalidate(); // invalidate new SetRect(rc); Invalidate(); // update item rect when in-place active if (IsInPlaceActive()) SetItemRects(); }
BOOL COleClientItem::OnChangeItemPosition(const CRect& rectPos) { if (!IsInPlaceActive()) return FALSE; ASSERT_VALID(this); ASSERT(AfxIsValidAddress(&rectPos, sizeof(CRect), FALSE)); ASSERT_VALID(m_pView); // determine the visible rect based on intersection between client rect CRect clipRect; OnGetClipRect(clipRect); CRect visRect; visRect.IntersectRect(clipRect, rectPos); // advise the server of the new visible rectangle if (!visRect.IsRectEmpty()) return SetItemRects(&rectPos, &clipRect); return FALSE; }