?? ex30view.cpp
字號:
// ex30View.cpp : implementation of the CEx30View class
//
#include "stdafx.h"
#include "ex30.h"
#include "ex30Doc.h"
#include "ex30View.h"
#include "card.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEx30View
IMPLEMENT_DYNCREATE(CEx30View, CView)
BEGIN_MESSAGE_MAP(CEx30View, CView)
//{{AFX_MSG_MAP(CEx30View)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CEx30View construction/destruction
CEx30View::CEx30View()
{
// TODO: add construction code here
}
CEx30View::~CEx30View()
{
}
BOOL CEx30View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CEx30View drawing
void CEx30View::OnDraw(CDC* pDC)
{
CEx30Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
lpCCard=pDoc->lpHead;
int y=4;
CRect rect;
GetClientRect(&rect);
CBrush GreenBrush(RGB(0,255,100));
while((lpCCard=lpCCard->NextCard())!=NULL)
{
if(lpCCard==pDoc->lpCurrent)
{
rect.top=y-4;
rect.bottom=y+20;
pDC->FillRect(&rect,&GreenBrush);
}
pDC->TextOut(0,y,lpCCard->GetName());
pDC->TextOut(300,y,lpCCard->GetMail());
y+=20;
}
GreenBrush.DeleteObject();
}
/////////////////////////////////////////////////////////////////////////////
// CEx30View printing
BOOL CEx30View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CEx30View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CEx30View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CEx30View diagnostics
#ifdef _DEBUG
void CEx30View::AssertValid() const
{
CView::AssertValid();
}
void CEx30View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CEx30Doc* CEx30View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx30Doc)));
return (CEx30Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CEx30View message handlers
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -