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