⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 traceview.cpp

📁 自编的串口通信程序
💻 CPP
字号:
// TraceView.cpp : implementation file
//

#include "stdafx.h"
#include "AutoDemo.h"
#include "TraceView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

INT DocStringType[]={CDocTemplate::windowTitle,
					CDocTemplate::docName   ,
					CDocTemplate::fileNewName   ,
					CDocTemplate::filterName,
					CDocTemplate::filterExt   ,
					CDocTemplate::regFileTypeId   ,
					CDocTemplate::regFileTypeName   
					};

/////////////////////////////////////////////////////////////////////////////
// CTraceView

IMPLEMENT_DYNCREATE(CTraceView, CEditView)

CTraceView::CTraceView()
{
	m_isDisplayed=FALSE;
}

CTraceView::~CTraceView()
{
}


BEGIN_MESSAGE_MAP(CTraceView, CEditView)
	//{{AFX_MSG_MAP(CTraceView)
	ON_WM_CREATE()
	ON_WM_SHOWWINDOW()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTraceView drawing

void CTraceView::OnDraw(CDC* pDC)
{
	CEditView::OnDraw(pDC);
	
	CDocument* pDoc = GetDocument();
	

	// TODO: add draw code here
/*	pDC->SetTextAlign(TA_UPDATECP);

	CDocTemplate * pTemplate=pDoc->GetDocTemplate();
	CPoint curPoint(0,0);
	CString strExt;
	for(int i=0;i<sizeof(DocStringType)/sizeof(INT);i++)
	{
		pTemplate->GetDocString(strExt,(CDocTemplate::DocStringIndex)DocStringType[i]);
		pDC->TextOut(curPoint.x,curPoint.y,CString(strExt));
		pDC->TextOut(0,0,CString(" _ "));
	
	CString str;

	pDC->TextOut(curPoint.x,curPoint.y,traceStr);}*/
}

/////////////////////////////////////////////////////////////////////////////
// CTraceView diagnostics

#ifdef _DEBUG
void CTraceView::AssertValid() const
{
	CView::AssertValid();
}

void CTraceView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif //_DEBUG


int CTraceView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here

	return 0;
}


void CTraceView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
	

	// TODO: Add your specialized code here and/or call the base class
	this->SetWindowText(traceStr);
	
}

void CTraceView::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CEditView::OnShowWindow(bShow, nStatus);
	// TODO: Add your message handler code here
	if(!m_isDisplayed)
	{
		::PostMessage(((CMDIFrameWnd*)(((CAutoDemoApp *)::AfxGetApp())->m_pMainWnd))->m_hWndMDIClient,WM_MDITILE,MDITILE_HORIZONTAL, 0);
		
		m_isDisplayed=TRUE;
	}

}

void CTraceView::OnInitialUpdate() 
{
	CEditView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
		CEdit &edit=GetEditCtrl();
     edit.SetReadOnly();
}


void CTraceView::OnDestroy() 
{
	CEditView::OnDestroy();
	
	CAutoDemoApp * pApp=(CAutoDemoApp *)::AfxGetApp();
	pApp->pDocScn=NULL;
	pApp->pDocTra=NULL;
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -