OverWriteView.cpp
上传用户:hngjqc
上传日期:2007-01-02
资源大小:25k
文件大小:2k
- // OverWriteView.cpp : implementation of the COverWriteView class
- //
- #include "stdafx.h"
- #include "OverWrite.h"
- #include "ChildFrm.h"
- #include "OverWriteDoc.h"
- #include "OverWriteView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // COverWriteView
- IMPLEMENT_DYNCREATE(COverWriteView, CRichEditView)
- BEGIN_MESSAGE_MAP(COverWriteView, CRichEditView)
- //{{AFX_MSG_MAP(COverWriteView)
- ON_WM_KEYDOWN()
- //}}AFX_MSG_MAP
- // Standard printing commands
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // COverWriteView construction/destruction
- COverWriteView::COverWriteView()
- {
- // TODO: add construction code here
- }
- COverWriteView::~COverWriteView()
- {
- }
- BOOL COverWriteView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CRichEditView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // COverWriteView drawing
- void COverWriteView::OnDraw(CDC* /* pDC */ )
- {
- COverWriteDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // COverWriteView diagnostics
- #ifdef _DEBUG
- void COverWriteView::AssertValid() const
- {
- CRichEditView::AssertValid();
- }
- void COverWriteView::Dump(CDumpContext& dc) const
- {
- CRichEditView::Dump(dc);
- }
- COverWriteDoc* COverWriteView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(COverWriteDoc)));
- return (COverWriteDoc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // COverWriteView message handlers
- void COverWriteView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
- {
- if (nChar == VK_INSERT)
- {
- BOOL bShift = GetKeyState(VK_SHIFT) < 0;
- BOOL bCtrl = GetKeyState(VK_CONTROL) < 0;
- if (!bShift && !bCtrl)
- ((CChildFrame *) GetParent())->ChangeOverwrite();
- }
-
-
- CRichEditView::OnKeyDown(nChar, nRepCnt, nFlags);
- }