?? topwindowview.cpp
字號:
// TopWindowView.cpp : implementation of the CTopWindowView class
//
#include "stdafx.h"
#include "TopWindow.h"
#include "TopWindowDoc.h"
#include "TopWindowView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTopWindowView
IMPLEMENT_DYNCREATE(CTopWindowView, CView)
BEGIN_MESSAGE_MAP(CTopWindowView, CView)
//{{AFX_MSG_MAP(CTopWindowView)
ON_WM_ERASEBKGND()
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CTopWindowView construction/destruction
CTopWindowView::CTopWindowView()
{
// TODO: add construction code here
}
CTopWindowView::~CTopWindowView()
{
}
BOOL CTopWindowView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CTopWindowView drawing
void CTopWindowView::OnDraw(CDC* pDC)
{
CTopWindowDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CTopWindowView printing
BOOL CTopWindowView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CTopWindowView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CTopWindowView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CTopWindowView diagnostics
#ifdef _DEBUG
void CTopWindowView::AssertValid() const
{
CView::AssertValid();
}
void CTopWindowView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CTopWindowDoc* CTopWindowView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTopWindowDoc)));
return (CTopWindowDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CTopWindowView message handlers
BOOL CTopWindowView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
// Create a pruple brush.
//創建一個紫色的刷子
CBrush Brush (RGB (128 , 0 , 128) );
// Select the brush into the device context .
//把紫色刷子選進設備環境
CBrush* pOldBrush = pDC->SelectObject (&Brush);
// Get the area that needs to be erased .
創建需要重畫的區域
CRect rcClip;
pDC ->GetClipBox (&rcClip);
//Paint the area.
重畫區域
pDC -> PatBlt (rcClip.left , rcClip.top , rcClip.Width ( ) , rcClip.Height( ) , PATCOPY );
//Unselect brush out of device context .
把紫色刷子選出設備環境
pDC ->SelectObject (pOldBrush );
// Return nonzero to half fruther processing .
return TRUE;
// return CView::OnEraseBkgnd(pDC);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -