DemoView.cpp
上传用户:shuini
上传日期:2007-02-05
资源大小:103k
文件大小:3k
- // DemoView.cpp : implementation of the CDemoView class
- //
- #include "stdafx.h"
- #include "Demo.h"
- #include "DemoDoc.h"
- #include "DemoView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDemoView
- IMPLEMENT_DYNCREATE(CDemoView, CEditView)
- BEGIN_MESSAGE_MAP(CDemoView, CEditView)
- //{{AFX_MSG_MAP(CDemoView)
- ON_COMMAND(ID_OP, OnOp)
- //}}AFX_MSG_MAP
- // Standard printing commands
- ON_COMMAND(ID_FILE_PRINT, CEditView::OnFilePrint)
- ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
- ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDemoView construction/destruction
- CDemoView::CDemoView()
- {
- // TODO: add construction code here
- }
- CDemoView::~CDemoView()
- {
- }
- BOOL CDemoView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- BOOL bPreCreated = CEditView::PreCreateWindow(cs);
- cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL); // Enable word-wrapping
- return bPreCreated;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDemoView drawing
- void CDemoView::OnDraw(CDC* pDC)
- {
- pDC;
- CDemoDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDemoView printing
- BOOL CDemoView::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default CEditView preparation
- return CEditView::OnPreparePrinting(pInfo);
- }
- void CDemoView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
- {
- // Default CEditView begin printing.
- CEditView::OnBeginPrinting(pDC, pInfo);
- }
- void CDemoView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
- {
- // Default CEditView end printing
- CEditView::OnEndPrinting(pDC, pInfo);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDemoView diagnostics
- #ifdef _DEBUG
- void CDemoView::AssertValid() const
- {
- CEditView::AssertValid();
- }
- void CDemoView::Dump(CDumpContext& dc) const
- {
- CEditView::Dump(dc);
- }
- CDemoDoc* CDemoView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDemoDoc)));
- return (CDemoDoc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CDemoView message handlers
- void CDemoView::OnOp()
- {
- OnEditUndo();
-
- }