UND_Copy.cpp
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:2k
源码类别:

绘图程序

开发平台:

Visual C++

  1. // UND_Copy.cpp: implementation of the CUND_Copy class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "graphsoft.h"
  6. #include "UND_Copy.h"
  7. #include "Core.h"
  8. #include "GraphDefines.h"
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char THIS_FILE[]=__FILE__;
  12. #define new DEBUG_NEW
  13. #endif
  14. //////////////////////////////////////////////////////////////////////
  15. // Construction/Destruction
  16. //////////////////////////////////////////////////////////////////////
  17. CUND_Copy::CUND_Copy()
  18. {
  19. CString str;
  20. str.LoadString(IDS_COPY);
  21. SetTitle(str);
  22. m_pSCopy=NULL;
  23. }
  24. CUND_Copy::CUND_Copy(void* pVoid)
  25. {
  26. m_pSCopy=NULL;
  27. m_pSCopy=(SUNDCopy*)pVoid;
  28. CString str;
  29. str.LoadString(IDS_COPY);
  30. SetTitle(str);
  31. }
  32. CUND_Copy::~CUND_Copy()
  33. {
  34. if(m_pSCopy!=NULL){
  35. for (int ii = 0; ii < m_pSCopy->ArrShape.GetSize(); ii++)
  36. delete m_pSCopy->ArrShape[ii];
  37. m_pSCopy->ArrShape.RemoveAll();
  38. delete m_pSCopy;
  39. m_pSCopy=NULL;
  40. }
  41. }
  42. void CUND_Copy::Destroy()
  43. {
  44. }
  45. BOOL CUND_Copy::OnEditUndo(CCore *pCore)
  46. {
  47. int nShapeNum=m_pSCopy->ArrShape.GetSize();
  48. CShape* pShape;
  49. CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
  50. for(int i=0;i<nShapeNum;i++){
  51. pShape=m_pSCopy->ArrShape.GetAt(i);
  52. pCore->DrawGraph(pShape,FALSE);
  53. pCore->ReMoveShape(pShape->GetID());
  54. }
  55. return TRUE;
  56. }
  57. BOOL CUND_Copy::OnEditRedo(CCore *pCore)
  58. {
  59. int nShapeNum=m_pSCopy->ArrShape.GetSize();
  60. CShape* pShape;
  61. CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
  62. for(int i=0;i<nShapeNum;i++){
  63. pShape=m_pSCopy->ArrShape.GetAt(i);
  64. pCore->DrawGraph(pShape,TRUE);
  65. pCore->m_pDoc->m_shapeList.AddTail(pShape);
  66. }
  67. return TRUE;
  68. }
  69. BOOL CUND_Copy::OutputLog(CCore *pCore) 
  70. //未做
  71. return false; 
  72. }