UND_Delete.cpp
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:2k
源码类别:
绘图程序
开发平台:
Visual C++
- // UND_Delete.cpp: implementation of the CUND_Delete class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "graphsoft.h"
- #include "UND_Delete.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_Delete::CUND_Delete()
- {
- CString str;
- str.LoadString(IDS_DELETE);
- SetTitle(str);
- m_pSDelete=NULL;
- }
- CUND_Delete::CUND_Delete(void* pVoid)
- {
- m_pSDelete=NULL;
- m_pSDelete=(SUNDDelete*)pVoid;
- CString str;
- str.LoadString(IDS_DELETE);
- SetTitle(str);
- }
- CUND_Delete::~CUND_Delete()
- {
- if(m_pSDelete!=NULL){
- delete m_pSDelete;
- m_pSDelete=NULL;
- }
- }
- //只有在最后的时候在调用到
- void CUND_Delete::Destroy()
- {
- if(m_pSDelete!=NULL){
- //for (int ii = 0; ii < m_pSDelete->ArrShape.GetSize(); ii++){
- // delete m_pSDelete->ArrShape[ii];
- //}
- m_pSDelete->ArrShape.RemoveAll();
- delete m_pSDelete;
- m_pSDelete=NULL;
- }
- }
- BOOL CUND_Delete::OnEditUndo(CCore *pCore)
- {
- int nShapeNum=m_pSDelete->ArrShape.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=m_pSDelete->ArrShape.GetAt(i);
- pCore->DrawGraph(pShape,TRUE);
- pCore->m_pDoc->m_shapeList.AddTail(pShape);
- }
- return TRUE;
- }
- BOOL CUND_Delete::OnEditRedo(CCore *pCore)
- {
- int nShapeNum=m_pSDelete->ArrShape.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=m_pSDelete->ArrShape.GetAt(i);
- pCore->DrawGraph(pShape,FALSE);
- pCore->ReMoveShape(pShape->GetID());
- }
- return TRUE;
- }
- BOOL CUND_Delete::OutputLog(CCore *pCore)
- {
- //未做
- return false;
- }