}
CContainerDoc* CContainerView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CContainerDoc)));
return (CContainerDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CContainerView message handlers
BOOL CContainerView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
if((m_pSelection)&&(pWnd==this))
{
CRectTracker tracker;
SetupTracker(&tracker,m_pSelection);
bool m_bCursorCaptured=tracker.SetCursor(this,nHitTest);
if(m_bCursorCaptured)
return true;
}
return CView::OnSetCursor(pWnd, nHitTest, message);
}
void CContainerView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CContainerCntrItem* pHitItem=GetHitItem(point);
SetObjectAsSelected(pHitItem);
if(pHitItem==NULL)
return;
CRectTracker tracker;
SetupTracker(&tracker,pHitItem);
UpdateWindow();
if(!tracker.Track(this,point))
return;
Invalidate();
pHitItem->m_objectRect=tracker.m_rect;
CContainerDoc* pDoc=GetDocument();
pDoc->SetModifiedFlag();
CView::OnLButtonDown(nFlags, point);
}
void CContainerView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
OnLButtonDown(nFlags,point);[br
上一篇:
ContainerTest.cpp
下一篇:
多年来只想说一句,我不怪你