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.
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
//////////////////////////////////////////////////////////////////////////////
|
|
//文件 ActionLayerAddItem.h
|
|
//主要功能:
|
|
//
|
|
//程序编写: 2006-12-07
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "StdAfx.h"
|
|
#include ".\actionaddlayeritem.h"
|
|
#include "SigmaView.h"
|
|
#include "SigmaDoc.h"
|
|
#include "Visitor.h"
|
|
|
|
NAction::CActionLayerAddItem::CActionLayerAddItem()
|
|
{
|
|
}
|
|
|
|
CActionLayerAddItem::CActionLayerAddItem(CSigmaDoc * ppDoc, CLayer* pAddedLayer, const CString curLayerName)
|
|
: CActionLayerDeleteItem(ppDoc, NULL)
|
|
, m_curLayerName(curLayerName)
|
|
{
|
|
this->SetActionType(ActionType::ActionTypeLayerAdd);
|
|
|
|
LayerList.AddTail(pAddedLayer);
|
|
}
|
|
|
|
CActionLayerAddItem::~CActionLayerAddItem(void)
|
|
{
|
|
Clear();
|
|
}
|
|
|
|
void CActionLayerAddItem::Undo()
|
|
{
|
|
//删除类别
|
|
GetDoc()->GetDraw()->SetCurrentLayer(m_curLayerName);
|
|
CActionLayerDeleteItem::Redo();
|
|
}
|
|
|
|
void CActionLayerAddItem::Redo()
|
|
{
|
|
//增加类别
|
|
CActionLayerDeleteItem::Undo();
|
|
if(LayerList.GetCount()>0)
|
|
{
|
|
CLayer* pLayer=(CLayer*)LayerList.GetHead();
|
|
GetDoc()->GetDraw()->SetCurrentLayer(pLayer);
|
|
}
|
|
//ReflashLayer();
|
|
}
|
|
|
|
void CActionLayerAddItem::Finish(void)
|
|
{
|
|
CActionItem::Finish();
|
|
}
|
|
|
|
void NAction::CActionLayerAddItem::accept(CActionVisitor& visitor)
|
|
{
|
|
visitor.visit(*this);
|
|
}
|