⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex_3view.cpp

📁 本压缩软件为《Visual C++6.0基础教程》(黑魔方系列)一书的源代码
💻 CPP
字号:
// EX_3View.cpp : implementation of the CEX_3View class
//

#include "stdafx.h"
#include "EX_3.h"
#include "MainFrm.h"
#include "EX_3Doc.h"
#include "EX_3View.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CEX_3View

IMPLEMENT_DYNCREATE(CEX_3View, CView)

BEGIN_MESSAGE_MAP(CEX_3View, CView)
	//{{AFX_MSG_MAP(CEX_3View)
	ON_WM_MOUSEMOVE()

	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CEX_3View construction/destruction

CEX_3View::CEX_3View()
{
	// TODO: add construction code here

}

CEX_3View::~CEX_3View()
{
}

BOOL CEX_3View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CEX_3View drawing

void CEX_3View::OnDraw(CDC* pDC)
{
	CEX_3Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CEX_3View printing

BOOL CEX_3View::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CEX_3View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CEX_3View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CEX_3View diagnostics

#ifdef _DEBUG
void CEX_3View::AssertValid() const
{
	CView::AssertValid();
}

void CEX_3View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CEX_3Doc* CEX_3View::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEX_3Doc)));
	return (CEX_3Doc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CEX_3View message handlers

void CEX_3View::OnMouseMove(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CString str;
	CMainFrame* pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd;
	CStatusBar* pStatus=&pFrame->m_wndStatusBar;
	if(pStatus)
	{
		str.Format("X=%d",point.x);
		pStatus->SetPaneText(2,str);
		str.Format("Y=%d",point.y);
		pStatus->SetPaneText(3,str);
	}
	
	CView::OnMouseMove(nFlags, point);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -