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

📄 e0502view.cpp

📁 Visualc++6.0自学手册第5章
💻 CPP
字号:
// E0502View.cpp : implementation of the CE0502View class
//

#include "stdafx.h"
#include "E0502.h"

#include "E0502Doc.h"
#include "E0502View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CE0502View

IMPLEMENT_DYNCREATE(CE0502View, CView)

BEGIN_MESSAGE_MAP(CE0502View, CView)
	//{{AFX_MSG_MAP(CE0502View)
	ON_WM_RBUTTONUP()
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CE0502View construction/destruction

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

}

CE0502View::~CE0502View()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CE0502View drawing

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

/////////////////////////////////////////////////////////////////////////////
// CE0502View printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CE0502View diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CE0502View message handlers

void CE0502View::OnRButtonUp(UINT nFlags, CPoint point) 
{
	CPoint PopupPoint = point;
	ClientToScreen(&PopupPoint);

	m_PopupMenu.LoadMenu(IDR_MENU1);
	m_PopupMenu.GetSubMenu(0)->TrackPopupMenu(TPM_RIGHTBUTTON | TPM_LEFTALIGN,
		PopupPoint.x, PopupPoint.y, AfxGetMainWnd());
	m_PopupMenu.DestroyMenu();
	
	CView::OnRButtonUp(nFlags, point);
}

⌨️ 快捷键说明

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