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

📄 droptoolbarview.cpp

📁 MFC程序开发参考大全 【明日科技】宋坤 刘锐宁 李伟明 【丛 书 名】 软件工程师典藏 【出 版 社】 人民邮电出版社 本书详细介绍了MFC框架中所有常用类及控件的应用
💻 CPP
字号:
// DropToolBarView.cpp : implementation of the CDropToolBarView class
//

#include "stdafx.h"
#include "DropToolBar.h"

#include "DropToolBarDoc.h"
#include "DropToolBarView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDropToolBarView

IMPLEMENT_DYNCREATE(CDropToolBarView, CView)

BEGIN_MESSAGE_MAP(CDropToolBarView, CView)
	//{{AFX_MSG_MAP(CDropToolBarView)
	ON_COMMAND(ID_FONT, OnFont)
	ON_COMMAND(ID_MENU200, OnMenu200)
	ON_COMMAND(ID_MENU150, OnMenu150)
	ON_COMMAND(ID_MENU100, OnMenu100)
	ON_COMMAND(ID_MENU50, OnMenu50)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CDropToolBarView construction/destruction

CDropToolBarView::CDropToolBarView()
{
	// TODO: add construction code here
	Font.CreatePointFont(120,"宋体");
}

CDropToolBarView::~CDropToolBarView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CDropToolBarView drawing

void CDropToolBarView::OnDraw(CDC* pDC)
{
	CDropToolBarDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	pDC->SelectObject(&Font);
	pDC->TextOut(100,40,"彼黍离离,彼稷之苗。");
	pDC->TextOut(100,80,"行迈靡靡,中心摇摇。");
	pDC->TextOut(100,120,"知我者  ,谓我心忧。");
	pDC->TextOut(100,160,"不知我者,谓我何求。");
	pDC->TextOut(100,200,"悠悠苍天,此何人哉。");
	Font.DeleteObject();
}

/////////////////////////////////////////////////////////////////////////////
// CDropToolBarView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CDropToolBarView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CDropToolBarView message handlers

void CDropToolBarView::OnFont() 
{
	OnMenu100();
}

void CDropToolBarView::OnMenu200() 
{
	Font.CreatePointFont(240,"宋体");
	Invalidate();
}

void CDropToolBarView::OnMenu150() 
{
	Font.CreatePointFont(180,"宋体");
	Invalidate();
}

void CDropToolBarView::OnMenu100() 
{
	Font.CreatePointFont(120,"宋体");
	Invalidate();
}

void CDropToolBarView::OnMenu50() 
{
	Font.CreatePointFont(60,"宋体");
	Invalidate();
}

⌨️ 快捷键说明

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