debugoutinfoview.cpp

来自「一个PLX教学编译器IDE」· C++ 代码 · 共 51 行

CPP
51
字号

#include "stdafx.h"
#include "plxc.h"
#include "DebugOutInfoView.h"

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

CDebugOutInfoView::CDebugOutInfoView()
{
	m_strWndText = _T("");
	m_brBackGround.CreateSolidBrush(RGB(255,255,255));
}

CDebugOutInfoView::~CDebugOutInfoView()
{
	m_brBackGround.DeleteObject();
}

BEGIN_MESSAGE_MAP(CDebugOutInfoView, CEdit)
	//{{AFX_MSG_MAP(CDebugOutInfoView)
	ON_WM_CTLCOLOR_REFLECT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CDebugOutInfoView::AddText(LPCTSTR strError, int errorLine)
{
	m_strWndText += (CString(strError) + CString(_T("\r\n")));	
    SetWindowText(m_strWndText);
	
	CRect rc;
	GetClientRect(rc);
    int lineNum = rc.Height() / 16;

	LineScroll((errorLine / lineNum) * lineNum);	
}

void CDebugOutInfoView::Clean()
{
    m_strWndText = _T("");
}

HBRUSH CDebugOutInfoView::CtlColor(CDC* pDC, UINT nCtlColor) 
{
	pDC->SetTextColor(RGB(125,125,125));
	return m_brBackGround;
}

⌨️ 快捷键说明

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