📄 datamangerview.cpp
字号:
// DataMangerView.cpp : implementation of the CDataMangerView class
//
#include "stdafx.h"
#include "DataManger.h"
#include "DataMangerDoc.h"
#include "DataMangerView.h"
#include "DataImport.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDataMangerView
IMPLEMENT_DYNCREATE(CDataMangerView, CEditView)
BEGIN_MESSAGE_MAP(CDataMangerView, CEditView)
//{{AFX_MSG_MAP(CDataMangerView)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CDataMangerView construction/destruction
CDataMangerView::CDataMangerView()
{
// TODO: add construction code here
}
CDataMangerView::~CDataMangerView()
{
}
BOOL CDataMangerView::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;
}
/////////////////////////////////////////////////////////////////////////////
// CDataMangerView drawing
void CDataMangerView::OnDraw(CDC* pDC)
{
CDataMangerDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CDataMangerView printing
BOOL CDataMangerView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default CEditView preparation
return CEditView::OnPreparePrinting(pInfo);
}
void CDataMangerView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView begin printing.
CEditView::OnBeginPrinting(pDC, pInfo);
}
void CDataMangerView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView end printing
CEditView::OnEndPrinting(pDC, pInfo);
}
/////////////////////////////////////////////////////////////////////////////
// CDataMangerView diagnostics
#ifdef _DEBUG
void CDataMangerView::AssertValid() const
{
CEditView::AssertValid();
}
void CDataMangerView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
CDataMangerDoc* CDataMangerView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDataMangerDoc)));
return (CDataMangerDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CDataMangerView message handlers
void CDataMangerView::ShowMsg(char *lpszMessage, UINT bNeedShow)
{
if(bNeedShow==1)
{
CString strTemp;
CString currtime;
m_OpenMutex.Lock(2);
/************************************生成当前的文件名************************************/
COleDateTime dateTest;
dateTest = COleDateTime::GetCurrentTime();
currtime.Format("%02d月%02d日%02d时%02d分%02d秒 ", \
dateTest.GetMonth(), \
dateTest.GetDay(), dateTest.GetHour(), \
dateTest.GetMinute(),dateTest.GetSecond());
strTemp = currtime;
strTemp += lpszMessage;
strTemp += _T("\r\n");
int len = GetWindowTextLength();
if(GetEditCtrl().GetLineCount()>5000)
{
GetEditCtrl().SetSel(0,len);
GetEditCtrl().ReplaceSel("");
}
GetEditCtrl().SetSel(len,len);
GetEditCtrl().ReplaceSel(strTemp);
GetDocument()->SetModifiedFlag(FALSE);
m_OpenMutex.Unlock();
}
return;
}
void CDataMangerView::OnInitialUpdate()
{
CEditView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
this->GetEditCtrl().SetReadOnly(true);
}
void CDataMangerView::OnMenuClear()
{
int intMess=MessageBox("您将删除视图上所有的提示信息,确定删除吗?","警告信息",MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON1);
if(intMess == IDYES)
{
SetTimer(1,300,NULL);
int len = GetWindowTextLength();
GetEditCtrl().SetSel(0,len);
GetEditCtrl().ReplaceSel("");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -