📄 rectview.cpp
字号:
// RectView.cpp : implementation file
//
#include "stdafx.h"
#include "ex22.h"
#include "RectView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRectView
IMPLEMENT_DYNCREATE(CRectView, CView)
CRectView::CRectView()
{
}
CRectView::~CRectView()
{
}
BEGIN_MESSAGE_MAP(CRectView, CView)
//{{AFX_MSG_MAP(CRectView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRectView drawing
void CRectView::OnDraw(CDC* pDC)
{
CRectDoc* pDoc = GetDocument();
// TODO: add draw code here
CRect rect(0,0,pDoc->m_length,pDoc->m_width);//设定绘制圆形的矩形框
CBrush YellowBrush(RGB(200,150,0));
pDC->FillRect(&rect,&YellowBrush);
YellowBrush.DeleteObject();//释放画刷对象
}
/////////////////////////////////////////////////////////////////////////////
// CRectView diagnostics
#ifdef _DEBUG
void CRectView::AssertValid() const
{
CView::AssertValid();
}
void CRectView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CRectView message handlers
//获取对应的文档指针
CRectDoc * CRectView::GetDocument()
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CRectDoc)));
return (CRectDoc *) m_pDocument;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -