miningview.cpp

来自「用Visual c++写」· C++ 代码 · 共 139 行

CPP
139
字号
// miningView.cpp : implementation of the CMiningView class
//

#include "stdafx.h"
#include "mining.h"
#include "HuanYing.h"
#include "miningDoc.h"
#include "miningView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMiningView

IMPLEMENT_DYNCREATE(CMiningView, CFormView)

BEGIN_MESSAGE_MAP(CMiningView, CFormView)
	//{{AFX_MSG_MAP(CMiningView)
	
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMiningView construction/destruction

CMiningView::CMiningView()
	: CFormView(CMiningView::IDD)
{
	//{{AFX_DATA_INIT(CMiningView)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// TODO: add construction code here

}

CMiningView::~CMiningView()
{
}

void CMiningView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMiningView)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}

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

	return CFormView::PreCreateWindow(cs);
}

void CMiningView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();
	//欢迎界面
	CHuanYing	dlgHuanYing;
	int	nResult;
	nResult=dlgHuanYing.DoModal();

}

/////////////////////////////////////////////////////////////////////////////
// CMiningView printing

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

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

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

void CMiningView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
	// TODO: add customized printing code here
}

/////////////////////////////////////////////////////////////////////////////
// CMiningView diagnostics

#ifdef _DEBUG
void CMiningView::AssertValid() const
{
	CFormView::AssertValid();
}

void CMiningView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CMiningView message handlers



void CMiningView::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	CBitmap	bmp;
	bmp.LoadBitmap(IDB_BITMAP1);
	CRect	rect;
	GetClientRect(rect);
	CBrush   brush;     
    brush.CreatePatternBrush(&bmp);
    dc.FillRect(rect,&brush);   

}

⌨️ 快捷键说明

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