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.
kev/Drawer/Module/GeoSigmaDraw/ActionReplaceNameItem.cpp

57 lines
1.1 KiB
C++

//////////////////////////////////////////////////////////////////////////////
//Àà: ActionReplaceNameItem
//Ö÷Òª¹¦ÄÜ:
//
//³ÌÐò±àд: 2021-07-07
/////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include ".\actionreplacenameitem.h"
#include "SigmaDoc.h"
#include "SigmaView.h"
#include "Visitor.h"
NAction::CActionReplaceNameItem::CActionReplaceNameItem()
: CActionItem(nullptr, 0)
{
}
CActionReplaceNameItem::CActionReplaceNameItem(CSigmaDoc * ppDoc, UINT actionType, COne* pOne, CString strOldName, CString strNewName)
: CActionItem(ppDoc, actionType)
, m_pOne(pOne)
, m_strOldName(strOldName)
, m_strNewName(strNewName)
{
}
CActionReplaceNameItem::~CActionReplaceNameItem(void)
{
}
void CActionReplaceNameItem::Undo(void)
{
CActionItem::Undo();
if(m_pOne)
{
m_pOne->SetName(m_strOldName);
//GetDoc()->Invalidate();
}
}
void CActionReplaceNameItem::Redo(void)
{
CActionItem::Redo();
if(m_pOne)
{
m_pOne->SetName(m_strNewName);
//GetDoc()->Invalidate(m_pOne);
}
}
void NAction::CActionReplaceNameItem::accept(CActionVisitor& visitor)
{
visitor.visit(*this);
}