【VC开源代码栏目提醒】:网学会员为需要VC开源代码的朋友们搜集整理了DrawCtrlView.cpp相关资料,希望对各位网友有所帮助!
// DrawCtrlView.cpp : implementation of the CDrawCtrlView class
//
#include "stdafx.h"
#include "DrawCtrl.h"
#include "DrawCtrlDoc.h"
#include "DrawCtrlView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDrawCtrlView
IMPLEMENT_DYNCREATE(CDrawCtrlView, CView)
BEGIN_MESSAGE_MAP(CDrawCtrlView, CView)
//{{AFX_MSG_MAP(CDrawCtrlView)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CDrawCtrlView construction/destruction
CDrawCtrlView::CDrawCtrlView()
{
// TODO: add construction code here
}
CDrawCtrlView::~CDrawCtrlView()
{
}
BOOL CDrawCtrlView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CDrawCtrlView drawing
void CDrawCtrlView::OnDraw(CDC* pDC)
{
CDrawCtrlDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
//绘制按钮
CRect rc(50,50,120,80);
pDC->DrawFrameControl(rc,DFC_BUTTON,DFCS_BUTTONPUSH);
//绘制标题栏关闭按钮
CRect CapRC(130,50,160,80);
pDC->DrawFrameControl(CapRC,DFC_CAPTION,DFCS_CAPTIONHELP);
//绘制滚动条按钮
CRect ScrollRC(170,50,200,80);
pDC->DrawFrameControl(ScrollRC,DFC_SCROLL,DFCS_SCROLLCOMBOBOX);
}
/////////////////////////////////////////////////////////////////////////////
// CDrawCtrlView printing
BOOL CDrawCtrlView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CDrawCtrlView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CDrawCtrlView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CDrawCtrlView diagnostics
#ifdef _DEBUG
void CDrawCtrlView::AssertValid() const
{
CView::AssertValid();
}
void CDrawCtrlView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CDrawCtrlDoc* CDrawCtrlView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDrawCtrlDoc)));
return (CDrawCtrlDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CDrawCtrlView message handlers
上一篇:
consumeF.pas
下一篇:
科研管理杂志简介