📄 exam3_3view.cpp
字号:
// Exam3_3View.cpp : implementation of the CExam3_3View class
//
#include "stdafx.h"
#include "Exam3_3.h"
#include "Exam3_3Doc.h"
#include "Exam3_3View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExam3_3View
IMPLEMENT_DYNCREATE(CExam3_3View, CView)
BEGIN_MESSAGE_MAP(CExam3_3View, CView)
//{{AFX_MSG_MAP(CExam3_3View)
ON_WM_RBUTTONDBLCLK()
ON_COMMAND(ID_VIEW_SNDMSG, OnViewSndmsg)
//}}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)
ON_MESSAGE(WM_EXAMPLE,OnExample)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExam3_3View construction/destruction
CExam3_3View::CExam3_3View()
{
// TODO: add construction code here
}
CExam3_3View::~CExam3_3View()
{
}
BOOL CExam3_3View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CExam3_3View drawing
void CExam3_3View::OnDraw(CDC* pDC)
{
CExam3_3Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CExam3_3View printing
BOOL CExam3_3View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CExam3_3View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CExam3_3View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CExam3_3View diagnostics
#ifdef _DEBUG
void CExam3_3View::AssertValid() const
{
CView::AssertValid();
}
void CExam3_3View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CExam3_3Doc* CExam3_3View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CExam3_3Doc)));
return (CExam3_3Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CExam3_3View message handlers
void CExam3_3View::OnRButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CString str;
str.Format("now:%d,%d",point.x,point.y );
MessageBox(str);
CView::OnRButtonDblClk(nFlags, point);
}
LRESULT CExam3_3View::OnExample(WPARAM wParam,LPARAM lParam)
{
AfxMessageBox("This is a user defined message!");
return 1;
}
void CExam3_3View::OnViewSndmsg()
{
// TODO: Add your command handler code here
this->SendMessage(WM_EXAMPLE,0,0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -