Microsoft Visual C++ MFC. Win95 WinNT



             

- 5


CClientDC dc(this);

dc.Rectangle(point.x-10, point.y-10,

point.x+10,point.y+10);

//

CFigure OneFigure;

OneFigure.xyFigCenter = point;

OneFigure.cType = 'R';

// , ,

//

pDoc->arrayFig.Add(OneFigure);

// OnRButtonDown CView

CView::OnRButtonDown(nFlags, point);

}

. , . OnDraw CSingleView.

//////////////////////////////////////////////////////////////

// OnDraw

void CSingleView::OnDraw(CDC* pDC)

{

CSingleDoc* pDoc = GetDocument();

ASSERT_VALID(pDoc);

// TODO:

int i;

for (i=0; i<pDoc->arrayFig.GetSize(); i++)

{

if(pDoc->arrayFig[i].cType == 'E')

pDC->Ellipse(pDoc->arrayFig[i].xyFigCenter.x-10,

pDoc->arrayFig[i].xyFigCenter.y-10,

pDoc->arrayFig[i].xyFigCenter.x+10,

pDoc->arrayFig[i].xyFigCenter.y+10);

else if (pDoc->arrayFig[i].cType == 'R')

pDC->Rectangle(pDoc->arrayFig[i].xyFigCenter.x-10,

pDoc->arrayFig[i].xyFigCenter.y-10,

pDoc->arrayFig[i].xyFigCenter.x+10,

pDoc->arrayFig[i].xyFigCenter.y+10);

}

}

. , , . , , .

. . (. 5.14). File Print Preview

. 5.14.