ex75View.cpp
资源名称:VC6.0.rar [点击查看]
上传用户:qdhmjx
上传日期:2022-07-11
资源大小:2226k
文件大小:2k
源码类别:
书籍源码
开发平台:
Visual C++
- // ex75View.cpp : implementation of the CEx75View class
- //
- #include "stdafx.h"
- #include "ex75.h"
- #include "ex75Doc.h"
- #include "ex75View.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CEx75View
- IMPLEMENT_DYNCREATE(CEx75View, CView)
- BEGIN_MESSAGE_MAP(CEx75View, CView)
- //{{AFX_MSG_MAP(CEx75View)
- ON_COMMAND(ID_COLORDIALOG, OnColordialog)
- //}}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()
- /////////////////////////////////////////////////////////////////////////////
- // CEx75View construction/destruction
- CEx75View::CEx75View()
- {
- // TODO: add construction code here
- }
- CEx75View::~CEx75View()
- {
- }
- BOOL CEx75View::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx75View drawing
- void CEx75View::OnDraw(CDC* pDC)
- {
- CEx75Doc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- CPen mypen;
- mypen.CreatePen(PS_SOLID,3,crColor);
- pDC->SelectObject(&mypen);
- pDC->Ellipse(200,100,400,300);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx75View printing
- BOOL CEx75View::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CEx75View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CEx75View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx75View diagnostics
- #ifdef _DEBUG
- void CEx75View::AssertValid() const
- {
- CView::AssertValid();
- }
- void CEx75View::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CEx75Doc* CEx75View::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx75Doc)));
- return (CEx75Doc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CEx75View message handlers
- void CEx75View::OnColordialog()
- {
- CColorDialog colordialog(crColor);
- if(colordialog.DoModal()==IDOK)
- {
- crColor=colordialog.GetColor();
- }
- Invalidate();
- }