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

绘图程序

开发平台:

Visual C++

  1. // UND_Magnify.cpp: implementation of the CUND_Magnify class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "graphsoft.h"
  6. #include "UND_Magnify.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_Magnify::CUND_Magnify()
  18. {
  19. CString str;
  20. str.LoadString(IDS_MAGNIFY);
  21. SetTitle(str);
  22. m_pSMagnify=NULL;
  23. }
  24. CUND_Magnify::CUND_Magnify(void* pVoid)
  25. {
  26. m_pSMagnify=NULL;
  27. m_pSMagnify=(SUNDMagnify*)pVoid;
  28. CString str;
  29. str.LoadString(IDS_MAGNIFY);
  30. SetTitle(str);
  31. }
  32. CUND_Magnify::~CUND_Magnify()
  33. {
  34. if(m_pSMagnify!=NULL)
  35. delete m_pSMagnify;
  36. m_pSMagnify=NULL;
  37. }
  38. void CUND_Magnify::Destroy()
  39. {
  40. }
  41. BOOL CUND_Magnify::OnEditUndo(CCore *pCore)
  42. {
  43. int nShapeNum=m_pSMagnify->ArrId.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_pSMagnify->ArrId.GetAt(i));
  48. pCore->DrawGraph(pShape,FALSE);
  49. pShape->Magnify(pDC,m_pSMagnify->flCX,m_pSMagnify->flCY,1.0/m_pSMagnify->flScale);
  50. pCore->DrawGraph(pShape,TRUE);
  51. }
  52. pCore->m_pDoc->RefreshSelectGraph();
  53. return TRUE;
  54. }
  55. BOOL CUND_Magnify::OnEditRedo(CCore *pCore)
  56. {
  57. int nShapeNum=m_pSMagnify->ArrId.GetSize();
  58. CShape* pShape;
  59. CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
  60. for(int i=0;i<nShapeNum;i++){
  61. pShape=pCore->GetShapeByID(m_pSMagnify->ArrId.GetAt(i));
  62. pCore->DrawGraph(pShape,FALSE);
  63. pShape->Magnify(pDC,m_pSMagnify->flCX,m_pSMagnify->flCY,m_pSMagnify->flScale);
  64. pCore->DrawGraph(pShape,TRUE);
  65. }
  66. pCore->m_pDoc->RefreshSelectGraph();
  67. return TRUE;
  68. }
  69. BOOL CUND_Magnify::OutputLog(CCore *pCore) 
  70. //未做
  71. return false; 
  72. }