memoview.cpp
来自「这些源代码」· C++ 代码 · 共 121 行
CPP
121 行
// MemoView.cpp : implementation of the CMemoView class
//
#include "stdafx.h"
#include "Memo.h"
#include "MemoDoc.h"
#include "MemoView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMemoView
IMPLEMENT_DYNCREATE(CMemoView, CEditView)
BEGIN_MESSAGE_MAP(CMemoView, CEditView)
//{{AFX_MSG_MAP(CMemoView)
ON_COMMAND(IDM_VIEW_HEADER, OnViewHeader)
ON_UPDATE_COMMAND_UI(IDM_VIEW_HEADER, OnUpdateViewHeader)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CMemoView construction/destruction
CMemoView::CMemoView()
{
// TODO: add construction code here
}
CMemoView::~CMemoView()
{
}
BOOL CMemoView::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;
}
/////////////////////////////////////////////////////////////////////////////
// CMemoView drawing
void CMemoView::OnDraw(CDC* pDC)
{
CMemoDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CMemoView printing
BOOL CMemoView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default CEditView preparation
return CEditView::OnPreparePrinting(pInfo);
}
void CMemoView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView begin printing.
CEditView::OnBeginPrinting(pDC, pInfo);
}
void CMemoView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView end printing
CEditView::OnEndPrinting(pDC, pInfo);
}
/////////////////////////////////////////////////////////////////////////////
// CMemoView diagnostics
#ifdef _DEBUG
void CMemoView::AssertValid() const
{
CEditView::AssertValid();
}
void CMemoView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
CMemoDoc* CMemoView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMemoDoc)));
return (CMemoDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMemoView message handlers
void CMemoView::OnViewHeader()
{
GetDocument()->ShowHeader ();
}
void CMemoView::OnUpdateViewHeader(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?