m_selection.RemoveAll();
UINT nFlags;
OnLButtonDown(nFlags,CPoint(0,0));
OnLButtonUp(nFlags,CPoint(0,0));
}
2.2.2用鼠标移动某一节点时,同步移动与其相连接的箭线
void CSelectTool::OnMouseMove(CDrawView* pView, UINT nFlags, const CPoint& point)
{
if (pView->GetCapture() != pView)
{
…
CPoint local = point;
int BackConnect;
pView->ClientToDoc(local);
POSITION pos;
if (c_drawShape == arrow)
//判断鼠标移动绘制箭线过程中是否与某一节点相连
//此时函数是CRectTool::OnMouseMove()调用selectTool.OnMouseMove();而跳到这里
{
CRect circlerect;
CDrawNode* pForeCircle;
CDrawNode* pBackCircle;
pos=pView->GetDocument()->m_objects.GetHeadPosition();
if(pos!=NULL)
{
int i=0;
int num=pView->GetDocument()->m_objects.GetCount();
while(i<num)
{
CDrawNode* pDrawCircle=(CDrawNode*)pView->GetDocument()->m_objects.GetNext(pos);
if(pDrawCircle!=NULL)
{
|