【VC开源代码栏目提醒】:以下是网学会员为您推荐的VC开源代码-Ex06_4View.cpp,希望本篇文章对您学习有所帮助。
// Ex06_4View.cpp : implementation of the CEx06_4View class
//
#include "stdafx.h"
#include "Ex06_4.h"
#include "Ex06_4Doc.h"
#include "Ex06_4View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEx06_4View
IMPLEMENT_DYNCREATE(CEx06_4View, CView)
BEGIN_MESSAGE_MAP(CEx06_4View, CView)
//{{AFX_MSG_MAP(CEx06_4View)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CEx06_4View construction/destruction
CEx06_4View::CEx06_4View()
{
// TODO: add construction code here
}
CEx06_4View::~CEx06_4View()
{
}
BOOL CEx06_4View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CEx06_4View drawing
void CEx06_4View::OnDraw(CDC* pDC)
{
CEx06_4Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
pDC->TextOut(20,20,pDoc->m_name);
pDC->TextOut(80,20,pDoc->m_number);
pDC->TextOut(200,20,pDoc->m_tel);
pDC->TextOut(280,20,pDoc->m_college);
pDC->TextOut(400,20,pDoc->m_banji);
switch(pDoc->m_men)
{
case 0:
{
pDC->TextOut(150,20,"男");
break;
}
case 1:
{
pDC->TextOut(150,20,"女");
break;
}
}
if(pDoc->m_bCProgram)
{
pDC->TextOut(500,20,"C语言
程序设计");
}
if(pDoc->m_bsoftware)
{
pDC->TextOut(650,20,"
软件基础");
}
}
/////////////////////////////////////////////////////////////////////////////
// CEx06_4View printing
BOOL CEx06_4View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CEx06_4View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CEx06_4View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CEx06_4View diagnostics
#ifdef _DEBUG
void CEx06_4View::AssertValid() const
{
CView::AssertValid();
}
void CEx06_4View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CEx06_4Doc* CEx06_4View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx06_4Doc)));
return (CEx06_4Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CEx06_4View message handlers