📄 mbpcview.cpp
字号:
// mbpcView.cpp : implementation of the CMbpcView class
//
#include "stdafx.h"
#include "mbpc.h"
#include "MainFrm.h"
#include "mbpcDoc.h"
#include "mbpcView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMbpcView
IMPLEMENT_DYNCREATE(CMbpcView, CEditView)
BEGIN_MESSAGE_MAP(CMbpcView, CEditView)
//{{AFX_MSG_MAP(CMbpcView)
ON_WM_DESTROY()
ON_WM_TIMER()
ON_WM_CREATE()
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CMbpcView construction/destruction
CMbpcView::CMbpcView()
{
// TODO: add construction code here
m_nTimerFlag = 0;
}
CMbpcView::~CMbpcView()
{
}
BOOL CMbpcView::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 &= ~(ES_MULTILINE); // Enable word-wrapping
return bPreCreated;
}
/////////////////////////////////////////////////////////////////////////////
// CMbpcView drawing
void CMbpcView::OnDraw(CDC* pDC)
{
CMbpcDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CMbpcView printing
BOOL CMbpcView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default CEditView preparation
return CEditView::OnPreparePrinting(pInfo);
}
void CMbpcView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView begin printing.
CEditView::OnBeginPrinting(pDC, pInfo);
}
void CMbpcView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView end printing
CEditView::OnEndPrinting(pDC, pInfo);
}
/////////////////////////////////////////////////////////////////////////////
// CMbpcView diagnostics
#ifdef _DEBUG
void CMbpcView::AssertValid() const
{
CEditView::AssertValid();
}
void CMbpcView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
CMbpcDoc* CMbpcView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMbpcDoc)));
return (CMbpcDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMbpcView message handlers
void CMbpcView::OnDestroy()
{
CEditView::OnDestroy();
// TODO: Add your message handler code here
this->KillTimer(1);
GetDocument()->m_bView = TRUE;
}
void CMbpcView::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CMbpcDoc *pDoc = GetDocument();
CString str;
if(1 == nIDEvent)
{
m_nTimerFlag++;
if(m_nTimerFlag > 1)
{
m_nTimerFlag --;
}
else
{
for(int i = 0; i < 10; i++)
{
// GetEditCtrl().SetSel(0,0);
// str.Format("%d",i);
// GetEditCtrl().ReplaceSel(str);
}
}
m_nTimerFlag--;
}
CEditView::OnTimer(nIDEvent);
}
int CMbpcView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CEditView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
SetTimer(1, 1000, NULL);
GetDocument()->m_bView = TRUE;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -