UND_Copy.cpp
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:2k
源码类别:
绘图程序
开发平台:
Visual C++
- // UND_Copy.cpp: implementation of the CUND_Copy class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "graphsoft.h"
- #include "UND_Copy.h"
- #include "Core.h"
- #include "GraphDefines.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CUND_Copy::CUND_Copy()
- {
- CString str;
- str.LoadString(IDS_COPY);
- SetTitle(str);
- m_pSCopy=NULL;
- }
- CUND_Copy::CUND_Copy(void* pVoid)
- {
- m_pSCopy=NULL;
- m_pSCopy=(SUNDCopy*)pVoid;
- CString str;
- str.LoadString(IDS_COPY);
- SetTitle(str);
- }
- CUND_Copy::~CUND_Copy()
- {
- if(m_pSCopy!=NULL){
- for (int ii = 0; ii < m_pSCopy->ArrShape.GetSize(); ii++)
- delete m_pSCopy->ArrShape[ii];
- m_pSCopy->ArrShape.RemoveAll();
- delete m_pSCopy;
- m_pSCopy=NULL;
- }
- }
- void CUND_Copy::Destroy()
- {
- }
- BOOL CUND_Copy::OnEditUndo(CCore *pCore)
- {
- int nShapeNum=m_pSCopy->ArrShape.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=m_pSCopy->ArrShape.GetAt(i);
- pCore->DrawGraph(pShape,FALSE);
- pCore->ReMoveShape(pShape->GetID());
- }
- return TRUE;
- }
- BOOL CUND_Copy::OnEditRedo(CCore *pCore)
- {
- int nShapeNum=m_pSCopy->ArrShape.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=m_pSCopy->ArrShape.GetAt(i);
- pCore->DrawGraph(pShape,TRUE);
- pCore->m_pDoc->m_shapeList.AddTail(pShape);
- }
- return TRUE;
- }
- BOOL CUND_Copy::OutputLog(CCore *pCore)
- {
- //未做
- return false;
- }