You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
814 B
C++

#include "StdAfx.h"
#include "MouseToolOnePoint.h"
#include "GlobalFunction.h"
#include "GlobalDrawMgr.h"
#include "CommandCreat.h"
#include "ObjPoint.h"
#include "CommandMgr.h"
CMouseToolOnePoint::CMouseToolOnePoint(void)
{
}
CMouseToolOnePoint::~CMouseToolOnePoint(void)
{
}
void CMouseToolOnePoint::OnLButtonDown(UINT nFlags, CPoint point,CClientDC &dc)
{
Dbxy pt = gDraw->CPoint2Dbxy(point);
if(m_Status==_STATUS_1)
{
CObjPoint *p = new CObjPoint;
p->SetPt(pt);//设置基准点
CObjContainer Container;
Container.AddObject(p);
//创建撤销指令-------start
CCommandCreat *pCmd = new CCommandCreat;
gCommandMgr.AddUndoCommand(pCmd,Container.GetObjVec());
pCmd->Excute();
}
GetCurViewPtr()->RefreshView();
}