#include "StdAfx.h" #include "itemcircle.h" #include "SigmaDoc.h" namespace NItem { CItemEllipse::CItemEllipse(CSigmaDoc * ppDoc) : CItemFocusRect(ppDoc) , m_nWidthPosition(0) { m_dCurveWidth = 0.0; this->SetType(ITEM_ELLIPSE); } CItemEllipse::~CItemEllipse(void) { } void CItemEllipse::DoLButtonUp(CDC* pDC) { //CDC* pDCMem = GetDC()->GetDC(); GetDC()->Create(GetImgDC()); CRect8 rect = GetRect(); CEllipse* pc = new CEllipse(); CPoint2D pt = rect.CenterPoint(); pc->x0 = pt.x0; pc->y0 = pt.y0; pc->m_size.cx = fabs(rect.Width())*0.5; pc->m_size.cy = fabs(rect.Height())*0.5; if (GetDoc()->GetDraw() == NULL) { delete pc; return; } POSITION pos = AddElement(pc, DOUBLEFOX_ELLIPSE); COne* pOne = GetDoc()->GetDraw()->GetAt(pos); pOne->Draw(*GetDC()); } void CItemEllipse::DoDrawOther(CDC* pDC, int nButton) { GetDC()->Create(pDC); CItemFocusRect::DoDrawOther(pDC, nButton); CRect8 rect = GetRect(); int od = GetDC()->GetDC()->SetROP2(R2_NOTXORPEN); CRect rt = GetDC()->GetScreen(rect); rt.NormalizeRect(); GetDC()->GetDC()->Ellipse(&rt); GetDC()->GetDC()->SetROP2(od); } }