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

📄 myuiview.cpp

📁 初步设计的一个GUI
💻 CPP
字号:
// myUIView.cpp : implementation of the CMyUIView class
//

#include "stdafx.h"
#include "myUI.h"

#include "myUIDoc.h"
#include "myUIView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyUIView

IMPLEMENT_DYNCREATE(CMyUIView, CView)

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

/////////////////////////////////////////////////////////////////////////////
// CMyUIView construction/destruction

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

}

CMyUIView::~CMyUIView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CMyUIView drawing

void CMyUIView::OnDraw(CDC* pDC)
{
	CMyUIDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	switch( pDoc->m_test)
	{
		case CMyUIDoc::AUDIO :
			pDC->TextOut(0,0,"这是一个光盘!");
			break;

		case CMyUIDoc::BOOK :
			pDC->TextOut(0,0,"这是一本书!");
			break;
	}
}

/////////////////////////////////////////////////////////////////////////////
// CMyUIView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CMyUIView diagnostics

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

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

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

⌨️ 快捷键说明

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