【VC开源代码栏目提醒】:网学会员--在 VC开源代码编辑为广大网友搜集整理了:bgView.cpp绩等信息,祝愿广大网友取得需要的信息,参考学习。
// bgView.cpp : implementation of the CBgView class
//
#include "stdafx.h"
#include "bg.h"
#include "bgDoc.h"
#include "bgView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBgView
IMPLEMENT_DYNCREATE(CBgView, CView)
BEGIN_MESSAGE_MAP(CBgView, CView)
//{{AFX_MSG_MAP(CBgView)
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()
/////////////////////////////////////////////////////////////////////////////
// CBgView construction/destruction
CBgView::CBgView()
{
// TODO: add construction code here
}
CBgView::~CBgView()
{
}
BOOL CBgView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CBgView drawing
void CBgView::OnDraw(CDC* pDC)
{
CBgDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CBgView printing
BOOL CBgView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CBgView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CBgView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CBgView diagnostics
#ifdef _DEBUG
void CBgView::AssertValid() const
{
CView::AssertValid();
}
void CBgView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CBgDoc* CBgView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CBgDoc)));
return (CBgDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CBgView message handlers
BOOL CBgView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CBrush bBrush(RGB(0,125,255));
CBrush* pOldBrush=pDC->SelectObject(&bBrush);
CRect rt;
pDC->GetClipBox(&rt);
pDC->PatBlt(rt.left,rt.top,rt.Width(),rt.Height(),PATCOPY);
pDC->SelectObject(pOldBrush);
return true;//CView::OnEraseBkgnd(pDC);
}