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.
93 lines
1.7 KiB
C++
93 lines
1.7 KiB
C++
//////////////////////////////////////////////////////////////////////////////
|
|
//Îļþ ActionExchangeXyItem.h
|
|
//Ö÷Òª¹¦ÄÜ:
|
|
//
|
|
//³ÌÐò±àд: 2006-12-07
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "StdAfx.h"
|
|
#include ".\actionexchangexyitem.h"
|
|
#include "SigmaDoc.h"
|
|
#include "SigmaView.h"
|
|
#include "Visitor.h"
|
|
|
|
NAction::CActionExchangeXYItem::CActionExchangeXYItem()
|
|
: CActionItem(nullptr, 0)
|
|
{
|
|
}
|
|
|
|
CActionExchangeXYItem::CActionExchangeXYItem(CSigmaDoc * ppDoc, UINT actionType)
|
|
: CActionItem(ppDoc, actionType)
|
|
{
|
|
}
|
|
|
|
CActionExchangeXYItem::~CActionExchangeXYItem(void)
|
|
{
|
|
}
|
|
|
|
void CActionExchangeXYItem::Undo(void)
|
|
{
|
|
CActionItem::Undo();
|
|
|
|
GetDoc()->GetDraw()->ExchangeXY();
|
|
GetDoc()->Invalidate();
|
|
}
|
|
|
|
void CActionExchangeXYItem::Redo(void)
|
|
{
|
|
CActionItem::Redo();
|
|
|
|
GetDoc()->GetDraw()->ExchangeXY();
|
|
//GetDoc()->Invalidate();
|
|
}
|
|
|
|
void NAction::CActionExchangeXYItem::accept(CActionVisitor& visitor)
|
|
{
|
|
visitor.visit(*this);
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
NAction::CActionCutOutItem::CActionCutOutItem()
|
|
: CActionItem(nullptr, 0)
|
|
{
|
|
}
|
|
|
|
CActionCutOutItem::CActionCutOutItem(CSigmaDoc * ppDoc, UINT actionType, CXy* pBakXY)
|
|
: CActionItem(ppDoc, actionType)
|
|
{
|
|
m_pBakXY=pBakXY;
|
|
}
|
|
|
|
CActionCutOutItem::~CActionCutOutItem(void)
|
|
{
|
|
if(m_pBakXY)
|
|
delete m_pBakXY;
|
|
}
|
|
|
|
void CActionCutOutItem::Undo(void)
|
|
{
|
|
CActionItem::Undo();
|
|
Exchange();
|
|
GetDoc()->Invalidate();
|
|
}
|
|
|
|
void CActionCutOutItem::Redo(void)
|
|
{
|
|
CActionItem::Redo();
|
|
Exchange();
|
|
GetDoc()->Invalidate();
|
|
}
|
|
|
|
void NAction::CActionCutOutItem::accept(CActionVisitor& visitor)
|
|
{
|
|
visitor.visit(*this);
|
|
}
|
|
|
|
void NAction::CActionCutOutItem::Exchange(void)
|
|
{
|
|
//CXy* pxy=GetDoc()->m_pDraw;
|
|
//GetDoc()->m_pDraw=m_pBakXY;
|
|
//m_pBakXY=pxy;
|
|
}
|