📄 exam5_1view.cpp
字号:
// Exam5_1View.cpp : implementation of the CExam5_1View class
//
#include "stdafx.h"
#include "Exam5_1.h"
#include "Exam5_1Doc.h"
#include "Exam5_1View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExam5_1View
IMPLEMENT_DYNCREATE(CExam5_1View, CView)
BEGIN_MESSAGE_MAP(CExam5_1View, CView)
//{{AFX_MSG_MAP(CExam5_1View)
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()
/////////////////////////////////////////////////////////////////////////////
// CExam5_1View construction/destruction
CExam5_1View::CExam5_1View()
{
// TODO: add construction code here
m_LPoint.x=0;
m_LPoint.y=0;
}
CExam5_1View::~CExam5_1View()
{
}
BOOL CExam5_1View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CExam5_1View drawing
void CExam5_1View::OnDraw(CDC* pDC)
{
CExam5_1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
pDC->SetTextColor (RGB(255,0,0));
pDC->SetBkColor (RGB(0,0,0));
CString str;
str.Format("鼠标左键双击的位置是[%d,%d]",m_LPoint.x,m_LPoint.y);
pDC->TextOut(0,0,str);
}
/////////////////////////////////////////////////////////////////////////////
// CExam5_1View printing
BOOL CExam5_1View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CExam5_1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CExam5_1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CExam5_1View diagnostics
#ifdef _DEBUG
void CExam5_1View::AssertValid() const
{
CView::AssertValid();
}
void CExam5_1View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CExam5_1Doc* CExam5_1View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CExam5_1Doc)));
return (CExam5_1Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CExam5_1View message handlers
void CExam5_1View::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_LPoint=point;
Invalidate(TRUE);
CView::OnLButtonDblClk(nFlags, point);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -