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.

36 lines
612 B
C++

#include "StdAfx.h"
#include "CommandBase.h"
#include "EasyOperationMgr.h"
CCommandBase::CCommandBase(void)
{
}
CCommandBase::~CCommandBase(void)
{
}
//添加操作对象
void CCommandBase::AddOpObj(Sptr<CObjBase> p)
{
m_ObjContainer.AddObject(p);
}
void CCommandBase::AddOpObj(CObjBase *p)
{
//保存到智能指针
Sptr<CObjBase> sPtr(p);
AddOpObj(sPtr);
}
//是否有操作对象
bool CCommandBase::HasOpObj()
{
return !m_ObjContainer.Empty();
}
void CCommandBase::Excute()
{
ExcuteExt();
gEasyOperationMgr->Refresh();
}
void CCommandBase::Undo()
{
UndoExt();
gEasyOperationMgr->Refresh();
}