i++;
}
pos=pDoc->m_objects.GetHeadPosition();
if(pos!=NULL)
{
i=0;
num=pDoc->m_objects.GetCount();
while(i<num)
{//删除与接点相连的所有箭线
CDrawRect* pDrawRect=(CDrawRect*)pDoc->m_objects.GetNext(pos);
if(pDrawRect!=NULL)
{
if(nIndex==pDrawRect->m_ForeConnect)
{
pDoc->Remove(pDrawRect);
pDrawRect->Remove();
}
if(nIndex==pDrawRect->m_BackConnect)
{
pDoc->Remove(pDrawRect);
pDrawRect->Remove();
}
if(nIndex<pDrawRect->m_ForeConnect)
{
pDrawRect->m_ForeConnect--;
}
if(nIndex<pDrawRect->m_BackConnect)
{
pDrawRect->m_BackConnect--;
}
}
i++;
}
}
Invalidate();
pDoc->m_nIndex=m_num;
}
pObj->Remove();
}
|