Курсовая работа: Сапер
if (isInitAll)
{
// рисуем бомбу
CBrush brush;
brush. CreateSolidBrush(RGB(255, 255, 255));
CBrush * oldBrush = dc->SelectObject(&brush);
dc->Rectangle(8, 8, field. GetRows() * (SIZE + 2) + 10,
field. GetCols() * (SIZE + 2) + 10);
dc->SelectObject(oldBrush);
field. Draw(dc);
}
}
}
// The system calls this function to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CsaperDlg:: OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
void CsaperDlg:: OnLButtonDown(UINT nFlags, CPoint point)
{
if (! begin)
return;
if (point. x < 10 || point. x > (field. GetRows() * (SIZE + 2) + 3) ||
point. y < 10 || point. y > (field. GetCols() * (SIZE + 2) + 3))
return;
CDC * dc = GetDC();
int result;
result = field. Click(dc, point);