Date: May 19th, 2010
Time: 14:10-16:00
Open book; turn off computer & mobile phone
void CSketcherDoc::OnUpdateElementRectangle(CCmdUI *pCmdUI)
{
pCmdUI->SetCheck(m_Element == RECTANGLE);
if (m_Element == RECTANGLE)
{
pCmdUI->SetText(L"RECTANGLE");
}
else
{
pCmdUI->SetText(L"rectangle");
}
}
void CSketcherDoc::OnUpdateElementLine(CCmdUI *pCmdUI)
{
pCmdUI->SetCheck(m_Element == RECTANGLE);
if (m_Element == RECTANGLE)
{
pCmdUI->SetText(L"RECTANGLE");
}
else
{
pCmdUI->SetText(L"rectangle");
}
}
void CSketcherView::OnDraw(CDC* pDC)
{
CSketcherDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
CRect aRect(50, 100, 100, 50);
aRect.NormalizeRect();
pDC->MoveTo(aRect.left, aRect.top);
pDC->LineTo(aRect.right, aRect.bottom);
}
void CSketcherView::OnDraw(CDC* pDC)
{
CSketcherDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
for (int i=10; i<=50; i+=10)
pDC->Rectangle(CRect(CPoint(i,i), ___________ ));
}