#include "StdAfx.h" #include "MouseToolText.h" #include "GlobalFunction.h" #include "GlobalDrawMgr.h" #include "ObjTxt.h" #include "CommandCreat.h" #include "CommandMgr.h" CMouseToolText::CMouseToolText(void) { } CMouseToolText::~CMouseToolText(void) { } void CMouseToolText::OnLButtonDown(UINT nFlags, CPoint point,CClientDC &dc) { Dbxy pt = gDraw->CPoint2Dbxy(point); if(m_Status==_STATUS_1) { CObjTxt *p = new CObjTxt; p->SetPosition(pt);//设置基准点 p->SetUseCurFontName();//使用当前字体 p->Creat(); CObjContainer Container; Container.AddObject(p); //创建撤销指令-------start CCommandCreat *pCmd = new CCommandCreat; gCommandMgr.AddUndoCommand(pCmd,Container.GetObjVec()); pCmd->Excute(); } //结束 m_Status = _STATUS_END; OperateOver(); }