📄 s10_2view.cpp
字号:
// s10_2View.cpp : implementation of the CS10_2View class
//
#include "stdafx.h"
#include "s10_2.h"
#include "s10_2Doc.h"
#include "s10_2View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CS10_2View
IMPLEMENT_DYNCREATE(CS10_2View, CView)
BEGIN_MESSAGE_MAP(CS10_2View, CView)
//{{AFX_MSG_MAP(CS10_2View)
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CS10_2View construction/destruction
CS10_2View::CS10_2View()
{
// TODO: add construction code here
}
CS10_2View::~CS10_2View()
{
}
BOOL CS10_2View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CS10_2View drawing
void CS10_2View::OnDraw(CDC* pDC)
{
CS10_2Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CS10_2View printing
BOOL CS10_2View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CS10_2View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CS10_2View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CS10_2View diagnostics
#ifdef _DEBUG
void CS10_2View::AssertValid() const
{
CView::AssertValid();
}
void CS10_2View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CS10_2Doc* CS10_2View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CS10_2Doc)));
return (CS10_2Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CS10_2View message handlers
void CS10_2View::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CClientDC oDC(this); // oDC为当前客户区
CBrush oBrush(HS_DIAGCROSS, RGB(0, 0, 255)); // 定义一只画刷
CBrush *pOldBrush; // 定义旧画刷指针
pOldBrush = oDC.SelectObject(&oBrush); // 选择画刷
CRect oRectangle; // 矩形对象
GetClientRect(&oRectangle); // 获得当前客户区边界的矩形对象
oDC.Ellipse(oRectangle); // 画一个椭圆
oDC.SelectObject(pOldBrush);// 还原画刷
CView::OnLButtonDblClk(nFlags, point);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -