void CCtrlItem::OnChange(OLE_NOTIFICATION nCode, DWORD dwParam) { ASSERT_VALID(this); COleClientItem::OnChange(nCode, dwParam); // When an item is being edited (either in-place or fully open) // it sends OnChange notifications for changes in the state of the // item or visual appearance of its content. switch (nCode) { case OLE_CHANGED: if (m_pCtrlObj) m_pCtrlObj->Invalidate(); UpdateExtent(); break; case OLE_CHANGED_STATE: case OLE_CHANGED_ASPECT: m_pCtrlObj->Invalidate(); break; } // GetDocument()->UpdateAllViews(NULL); // for now just update ALL views/no hints }
void CRectItem::ResetSize() { ASSERT_VALID(this); Invalidate(); SetBaseSize(CSize(0, 0)); UpdateExtent(); }
void CRectItem::OnGetItemPosition(CRect& rPosition) { ASSERT_VALID(this); if (GetSize() == CSize(0,0)) UpdateExtent(); // copy m_rect, which is in document coordinates rPosition = GetRect(); CMainView* pView = GetActiveView(); ASSERT_VALID(pView); pView->DocToClient(rPosition); }
void CDrawItem::OnGetItemPosition(CRect& rPosition) { ASSERT_VALID(this); // update to extent of item if m_position is not initialized if (m_pDrawObj->m_position.IsRectEmpty()) UpdateExtent(); // copy m_position, which is in document coordinates CDrawView* pView = GetActiveView(); ASSERT_VALID(pView); rPosition = m_pDrawObj->m_position; pView->DocToClient(rPosition); }
void CRectItem::OnChange(OLE_NOTIFICATION nCode, DWORD dwParam) { COleClientItem::OnChange(nCode, dwParam); switch(nCode) { case OLE_CHANGED: UpdateExtent(); Invalidate(); break; case OLE_CHANGED_ASPECT: case OLE_CHANGED_STATE: Invalidate(); break; } }
void CCtrlItem::OnGetItemPosition(CRect& rPosition) { ASSERT_VALID(this); // update to extent of item if m_position is not initialized if (m_pCtrlObj->m_position.IsRectEmpty()) UpdateExtent(); // copy m_position, which is in document coordinates CLayoutView* pView = GetActiveView(); ASSERT_VALID(pView); rPosition = m_pCtrlObj->m_position.GetRECT(); //在位激活并且为窗口模式时变更坐标 if (IsInPlaceActive() && !m_bWindowless) pView->DocToClient(rPosition); }
void CDrawItem::OnChange(OLE_NOTIFICATION nCode, DWORD dwParam) { ASSERT_VALID(this); COleClientItem::OnChange(nCode, dwParam); switch(nCode) { case OLE_CHANGED_STATE: case OLE_CHANGED_ASPECT: m_pDrawObj->Invalidate(); break; case OLE_CHANGED: UpdateExtent(); // extent may have changed m_pDrawObj->Invalidate(); break; } }