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

绘图程序

开发平台:

Visual C++

  1. // UND_Property.cpp: implementation of the CUND_Property class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "graphsoft.h"
  6. #include "UND_Property.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_Property::CUND_Property()
  18. {
  19. CString str;
  20. str.LoadString(IDS_PROPERTY);
  21. SetTitle(str);
  22. m_pSProperty=NULL;
  23. }
  24. CUND_Property::CUND_Property(void* pVoid)
  25. {
  26. m_pSProperty=NULL;
  27. m_pSProperty=(SUNDProperty*)pVoid;
  28. CString str;
  29. str.LoadString(IDS_PROPERTY);
  30. SetTitle(str);
  31. }
  32. CUND_Property::~CUND_Property()
  33. {
  34. if(m_pSProperty!=NULL)
  35. delete m_pSProperty;
  36. m_pSProperty=NULL;
  37. }
  38. void CUND_Property::Destroy()
  39. {
  40. }
  41. BOOL CUND_Property::OnEditUndo(CCore *pCore)
  42. {
  43. int nShapeNum=m_pSProperty->ArrPropertyPrev.GetSize();
  44. CShape* pShape;
  45. CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
  46. for(int i=0;i<nShapeNum;i++){
  47. pShape=pCore->GetShapeByID(m_pSProperty->ArrPropertyPrev.GetAt(i).nID);
  48. pCore->DrawGraph(pShape,FALSE);
  49. COLORREF color =m_pSProperty->ArrPropertyPrev.GetAt(i).color;
  50. pShape->SetColor(m_pSProperty->ArrPropertyPrev.GetAt(i).color);
  51. pShape->SetFillColor(m_pSProperty->ArrPropertyPrev.GetAt(i).fillStyle);
  52. pShape->SetDrawPointsFlag(m_pSProperty->ArrPropertyPrev.GetAt(i).nPtShow);
  53. pShape->SetFillStyle(m_pSProperty->ArrPropertyPrev.GetAt(i).fillStyle);
  54. pShape->SetPenWidth(m_pSProperty->ArrPropertyPrev.GetAt(i).nPenWidth);
  55. pShape->Rotate(pDC,m_pSProperty->ArrPropertyPrev.GetAt(i).flRCX,m_pSProperty->ArrPropertyPrev.GetAt(i).flRCY,
  56.            m_pSProperty->ArrPropertyPrev.GetAt(i).flAngle);
  57. pCore->DrawGraph(pShape,TRUE);
  58. }
  59. return TRUE;
  60. }
  61. BOOL CUND_Property::OnEditRedo(CCore *pCore)
  62. {
  63. int nShapeNum=m_pSProperty->ArrPropertyCur.GetSize();
  64. CShape* pShape;
  65. CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
  66. for(int i=0;i<nShapeNum;i++){
  67. pShape=pCore->GetShapeByID(m_pSProperty->ArrPropertyCur.GetAt(i).nID);
  68. pCore->DrawGraph(pShape,FALSE);
  69. pShape->SetColor(m_pSProperty->ArrPropertyCur.GetAt(i).color);
  70. pShape->SetFillColor(m_pSProperty->ArrPropertyCur.GetAt(i).fillStyle);
  71. pShape->SetDrawPointsFlag(m_pSProperty->ArrPropertyCur.GetAt(i).nPtShow);
  72. pShape->SetFillStyle(m_pSProperty->ArrPropertyCur.GetAt(i).fillStyle);
  73. pShape->SetPenWidth(m_pSProperty->ArrPropertyCur.GetAt(i).nPenWidth);
  74. pShape->Rotate(pDC,m_pSProperty->ArrPropertyCur.GetAt(i).flRCX,m_pSProperty->ArrPropertyCur.GetAt(i).flRCY,
  75. m_pSProperty->ArrPropertyCur.GetAt(i).flAngle);
  76. pCore->DrawGraph(pShape,TRUE);
  77. }
  78. return TRUE;
  79. }
  80. BOOL CUND_Property::OutputLog(CCore *pCore) 
  81. //未做
  82. return false; 
  83. }