📄 adveditctrl.cpp
字号:
#include "stdafx.h"
#include "AdvEditCtrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CDebugView::CDebugView()
{
m_brBackGround.CreateSolidBrush(RGB(255,255,255));
strWndText = _T("--------------------------- Plx Debug ---------------------------\r\n \r\n \r\n");
m_vErrorLine.Add(-1);
m_vErrorLine.Add(-1);
m_nTextLines = 1;
}
CDebugView::~CDebugView()
{
m_brBackGround.DeleteObject();
}
BEGIN_MESSAGE_MAP(CDebugView, CEdit)
//{{AFX_MSG_MAP(CDebugView)
ON_WM_CTLCOLOR_REFLECT()
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
HBRUSH CDebugView::CtlColor(CDC* pDC, UINT nCtlColor)
{
return m_brBackGround;
}
void CDebugView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
int _min;
int _max;
GetSel(_min,_max);
int line=LineFromChar(_min);
GetParent()->PostMessage(WM_GETDBCLICKDEBUGMSG,getErrorLine(line),0);
}
void CDebugView::AddText(LPCTSTR strError,int errorLine)
{
strWndText += (CString(strError) + CString(_T("\r\n")));
SetWindowText(strWndText);
LineScroll(m_nTextLines++);
m_vErrorLine.Add(errorLine);
}
void CDebugView::Clean()
{
m_vErrorLine.RemoveAll();
strWndText = _T("------------------------------------ PlxBuilder Debug ---------------------------------\r\n \r\n");
m_vErrorLine.Add(-1);
m_vErrorLine.Add(-1);
m_nTextLines = 1;
SetWindowText(strWndText);
}
int CDebugView::getErrorLine(int index)
{
if(index <= -1 || index >= m_vErrorLine.GetSize())
return -2;
return m_vErrorLine.GetAt(index);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -