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

📄 custommenuview.cpp

📁 《VC++ 编程技巧与示例 .rar》各个示例代码绝对可用
💻 CPP
字号:
// CustomMenuView.cpp : implementation of the CCustomMenuView class
//

#include "stdafx.h"
#include "CustomMenu.h"

#include "CustomMenuDoc.h"
#include "CustomMenuView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCustomMenuView

IMPLEMENT_DYNCREATE(CCustomMenuView, CView)

BEGIN_MESSAGE_MAP(CCustomMenuView, CView)
	//{{AFX_MSG_MAP(CCustomMenuView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}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_COMMAND(ID_LINE_MENU  ,OnSolidLine)
	ON_COMMAND(ID_LINE_MENU+1,OnDashLine)
	ON_COMMAND(ID_LINE_MENU+2,OnDotLine)
	ON_COMMAND(ID_LINE_MENU+3,OnDashDotLine)

END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCustomMenuView construction/destruction

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

}

CCustomMenuView::~CCustomMenuView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CCustomMenuView drawing

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

/////////////////////////////////////////////////////////////////////////////
// CCustomMenuView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CCustomMenuView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CCustomMenuView message handlers

void CCustomMenuView::OnSolidLine()
{
	AfxMessageBox("Solid Line is choosen!");
}

void CCustomMenuView::OnDashLine()
{
	AfxMessageBox("Dash Line is choosen!");
}

void CCustomMenuView::OnDotLine()
{
	AfxMessageBox("Dot Line is choosen!");
}

void CCustomMenuView::OnDashDotLine()
{
	AfxMessageBox("Dash-Dot Line is choosen!");
}

⌨️ 快捷键说明

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