UND_Move.cpp
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:2k
源码类别:
绘图程序
开发平台:
Visual C++
- // UND_Move.cpp: implementation of the CUND_Move class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "graphsoft.h"
- #include "UND_Move.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_Move::CUND_Move()
- {
- CString str;
- str.LoadString(IDS_MOVE);
- SetTitle(str);
- m_pSMove=NULL;
- }
- CUND_Move::CUND_Move(void* pVoid)
- {
- m_pSMove=NULL;
- m_pSMove=(SUNDMove*)pVoid;
- CString str;
- str.LoadString(IDS_MOVE);
- SetTitle(str);
- }
- CUND_Move::~CUND_Move()
- {
- if(m_pSMove!=NULL)
- delete m_pSMove;
- m_pSMove=NULL;
- }
- void CUND_Move::Destroy()
- {
- }
- BOOL CUND_Move::OnEditUndo(CCore *pCore)
- {
- int nShapeNum=m_pSMove->ArrId.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=pCore->GetShapeByID(m_pSMove->ArrId.GetAt(i));
- pCore->DrawGraph(pShape,FALSE);
- pShape->Move(pDC,-m_pSMove->nStepX,-m_pSMove->nStepY);
- pCore->DrawGraph(pShape,TRUE);
- }
- return TRUE;
- }
- BOOL CUND_Move::OnEditRedo(CCore *pCore)
- {
- int nShapeNum=m_pSMove->ArrId.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=pCore->GetShapeByID(m_pSMove->ArrId.GetAt(i));
- pCore->DrawGraph(pShape,FALSE);
- pShape->Move(pDC,m_pSMove->nStepX,m_pSMove->nStepY);
- pCore->DrawGraph(pShape,TRUE);
- }
- return TRUE;
- }
- BOOL CUND_Move::OutputLog(CCore *pCore)
- {
- //未做
- return false;
- }