www.pudn.com > DrawCoin.rar > DrawCoinView.cpp


// DrawCoinView.cpp : implementation of the CDrawCoinView class 
// 
 
#include "stdafx.h" 
#include "DrawCoin.h" 
 
#include "DrawCoinDoc.h" 
#include "DrawCoinView.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CDrawCoinView 
 
IMPLEMENT_DYNCREATE(CDrawCoinView, CView) 
 
BEGIN_MESSAGE_MAP(CDrawCoinView, CView) 
	//{{AFX_MSG_MAP(CDrawCoinView) 
	ON_UPDATE_COMMAND_UI(ID_VIEW_MESSAGE, OnUpdateViewMessage) 
	//}}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() 
 
///////////////////////////////////////////////////////////////////////////// 
// CDrawCoinView construction/destruction 
 
CDrawCoinView::CDrawCoinView() 
{ 
	// TODO: add construction code here 
 
} 
 
CDrawCoinView::~CDrawCoinView() 
{ 
} 
 
BOOL CDrawCoinView::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	return CView::PreCreateWindow(cs); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CDrawCoinView drawing 
 
void CDrawCoinView::OnDraw(CDC* pDC) 
{ 
	CDrawCoinDoc* pDoc = GetDocument(); 
	ASSERT_VALID(pDoc); 
	// TODO: add draw code for native data here 
	for(int i=0;im_nCoins;i++) 
	{ 
		int y=200-10*i; 
		pDC->Ellipse(200,y,300,y-30); 
		pDC->Ellipse(200,y-10,300,y-35); 
	} 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CDrawCoinView printing 
 
BOOL CDrawCoinView::OnPreparePrinting(CPrintInfo* pInfo) 
{ 
	// default preparation 
	return DoPreparePrinting(pInfo); 
} 
 
void CDrawCoinView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add extra initialization before printing 
} 
 
void CDrawCoinView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add cleanup after printing 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CDrawCoinView diagnostics 
 
#ifdef _DEBUG 
void CDrawCoinView::AssertValid() const 
{ 
	CView::AssertValid(); 
} 
 
void CDrawCoinView::Dump(CDumpContext& dc) const 
{ 
	CView::Dump(dc); 
} 
 
CDrawCoinDoc* CDrawCoinView::GetDocument() // non-debug version is inline 
{ 
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDrawCoinDoc))); 
	return (CDrawCoinDoc*)m_pDocument; 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CDrawCoinView message handlers 
 
//DEL void CDrawCoinView::OnViewMessage()  
//DEL { 
//DEL 	// TODO: Add your command handler code here 
//DEL 	MessageBox("Invoke CMyMenuView member function !"); 
//DEL } 
 
void CDrawCoinView::OnUpdateViewMessage(CCmdUI* pCmdUI)  
{ 
	// TODO: Add your command update UI handler code here 
	pCmdUI->Enable(TRUE); 
}