// Eg5_1View.cpp : implementation of the CEg5_1View class
//

#include "stdafx.h"
#include "Eg5_1.h"

#include "Eg5_1Doc.h"
#include "Eg5_1View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEg5_1View

IMPLEMENT_DYNCREATE(CEg5_1View, CView)

BEGIN_MESSAGE_MAP(CEg5_1View, CView)
	//{{AFX_MSG_MAP(CEg5_1View)
	ON_COMMAND(ID_MESSAGE_DISPLAY, OnMessageDisplay)
	ON_COMMAND(ID_MESSAGE_STYLE_OKCANCEL, OnMessageStyleOkcancel)
	ON_COMMAND(ID_MESSAGE_STYLE_YESNO, OnMessageStyleYesno)
	ON_COMMAND(ID_MESSAGE_CHANGE, OnMessageChange)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CEg5_1View construction/destruction

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

}

CEg5_1View::~CEg5_1View()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CEg5_1View drawing

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

/////////////////////////////////////////////////////////////////////////////
// CEg5_1View printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CEg5_1View diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CEg5_1View message handlers

void CEg5_1View::OnMessageDisplay() 
{
	// TODO: Add your command handler code here
	MessageBox("这是一个简单的对话框");	

}

void CEg5_1View::OnMessageStyleOkcancel() 
{
	// TODO: Add your command handler code here
	MessageBox("这是一个有确定和取消按钮的对话框",
		     "OKCANCEL对话框",MB_OKCANCEL);

}

void CEg5_1View::OnMessageStyleYesno() 
{
	// TODO: Add your command handler code here
		MessageBox("这是一个有Yes和No按钮的消息框",
		       "YESNO消息框",MB_YESNO);

}

void CEg5_1View::OnMessageChange() 
{
	// TODO: Add your command handler code here
	MessageBox("这个对话框的标题已经改变了",
		     "新对话框");

}
