📄 firstview.cpp
字号:
// FirstView.cpp : implementation of the CFirstView class
//
#include "stdafx.h"
#include "Split.h"
#include "SplitDoc.h"
#include "FirstView.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFirstView
IMPLEMENT_DYNCREATE(CFirstView, CEditView)
BEGIN_MESSAGE_MAP(CFirstView, CEditView)
//{{AFX_MSG_MAP(CFirstView)
// 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, CEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFirstView construction/destruction
CFirstView::CFirstView()
{
// TODO: add construction code here
}
CFirstView::~CFirstView()
{
}
BOOL CFirstView::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
cs.style &= ~(WS_HSCROLL | WS_VSCROLL); // Enable word-wrapping
return bPreCreated;
}
/////////////////////////////////////////////////////////////////////////////
// CFirstView drawing
void CFirstView::OnDraw(CDC* pDC)
{
CSplitDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CFirstView printing
BOOL CFirstView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default CEditView preparation
return CEditView::OnPreparePrinting(pInfo);
}
void CFirstView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView begin printing.
CEditView::OnBeginPrinting(pDC, pInfo);
}
void CFirstView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView end printing
CEditView::OnEndPrinting(pDC, pInfo);
}
/////////////////////////////////////////////////////////////////////////////
// CFirstView diagnostics
#ifdef _DEBUG
void CFirstView::AssertValid() const
{
CEditView::AssertValid();
}
void CFirstView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
CSplitDoc* CFirstView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSplitDoc)));
return (CSplitDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFirstView message handlers
void CFirstView::OnInitialUpdate()
{
CMainFrame *frame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetApp()->GetMainWnd());
if (frame == NULL)
return;
CFirstView *pView = (CFirstView *)frame->GetActiveView();
if ((pView == this) || (pView == NULL))
return;
CString strText;
strText = pView->LockBuffer ();
pView->UnlockBuffer ();
SetWindowText (strText);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -