UND_Property.cpp
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:3k
源码类别:
绘图程序
开发平台:
Visual C++
- // UND_Property.cpp: implementation of the CUND_Property class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "graphsoft.h"
- #include "UND_Property.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_Property::CUND_Property()
- {
- CString str;
- str.LoadString(IDS_PROPERTY);
- SetTitle(str);
- m_pSProperty=NULL;
- }
- CUND_Property::CUND_Property(void* pVoid)
- {
- m_pSProperty=NULL;
- m_pSProperty=(SUNDProperty*)pVoid;
- CString str;
- str.LoadString(IDS_PROPERTY);
- SetTitle(str);
- }
- CUND_Property::~CUND_Property()
- {
- if(m_pSProperty!=NULL)
- delete m_pSProperty;
- m_pSProperty=NULL;
- }
- void CUND_Property::Destroy()
- {
- }
- BOOL CUND_Property::OnEditUndo(CCore *pCore)
- {
- int nShapeNum=m_pSProperty->ArrPropertyPrev.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=pCore->GetShapeByID(m_pSProperty->ArrPropertyPrev.GetAt(i).nID);
- pCore->DrawGraph(pShape,FALSE);
- COLORREF color =m_pSProperty->ArrPropertyPrev.GetAt(i).color;
- pShape->SetColor(m_pSProperty->ArrPropertyPrev.GetAt(i).color);
- pShape->SetFillColor(m_pSProperty->ArrPropertyPrev.GetAt(i).fillStyle);
- pShape->SetDrawPointsFlag(m_pSProperty->ArrPropertyPrev.GetAt(i).nPtShow);
- pShape->SetFillStyle(m_pSProperty->ArrPropertyPrev.GetAt(i).fillStyle);
- pShape->SetPenWidth(m_pSProperty->ArrPropertyPrev.GetAt(i).nPenWidth);
- pShape->Rotate(pDC,m_pSProperty->ArrPropertyPrev.GetAt(i).flRCX,m_pSProperty->ArrPropertyPrev.GetAt(i).flRCY,
- m_pSProperty->ArrPropertyPrev.GetAt(i).flAngle);
- pCore->DrawGraph(pShape,TRUE);
- }
- return TRUE;
- }
- BOOL CUND_Property::OnEditRedo(CCore *pCore)
- {
- int nShapeNum=m_pSProperty->ArrPropertyCur.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=pCore->GetShapeByID(m_pSProperty->ArrPropertyCur.GetAt(i).nID);
- pCore->DrawGraph(pShape,FALSE);
- pShape->SetColor(m_pSProperty->ArrPropertyCur.GetAt(i).color);
- pShape->SetFillColor(m_pSProperty->ArrPropertyCur.GetAt(i).fillStyle);
- pShape->SetDrawPointsFlag(m_pSProperty->ArrPropertyCur.GetAt(i).nPtShow);
- pShape->SetFillStyle(m_pSProperty->ArrPropertyCur.GetAt(i).fillStyle);
- pShape->SetPenWidth(m_pSProperty->ArrPropertyCur.GetAt(i).nPenWidth);
- pShape->Rotate(pDC,m_pSProperty->ArrPropertyCur.GetAt(i).flRCX,m_pSProperty->ArrPropertyCur.GetAt(i).flRCY,
- m_pSProperty->ArrPropertyCur.GetAt(i).flAngle);
- pCore->DrawGraph(pShape,TRUE);
- }
- return TRUE;
- }
- BOOL CUND_Property::OutputLog(CCore *pCore)
- {
- //未做
- return false;
- }