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

📄 gdbconsole.cpp

📁 一个完全使用MFC框架开发的C++编译器的代码。功能十分强大可以编译大型程序。
💻 CPP
字号:
// GdbConsole.cpp : implementation file
//

#include "stdafx.h"
#include "quincy.h"
#include "GdbConsole.h"

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

/////////////////////////////////////////////////////////////////////////////
// GdbConsole dialog


GdbConsole::GdbConsole(CWnd* pParent)
	: CDialog(GdbConsole::IDD, pParent)
{
	//{{AFX_DATA_INIT(GdbConsole)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void GdbConsole::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(GdbConsole)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(GdbConsole, CDialog)
	//{{AFX_MSG_MAP(GdbConsole)
		// NOTE: the ClassWizard will add message map macros here
	ON_WM_DESTROY()
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


void GdbConsole::scroll(CListBox* pList)
{
	pList->SetTopIndex(pList->GetCount() - 10);
}

/////////////////////////////////////////////////////////////////////////////
// GdbConsole message handlers

void GdbConsole::AddString(const char* str)
{
	CListBox* pList = static_cast<CListBox*>(GetDlgItem(IDC_GDBSTDIO));
	pList->AddString(str);
	scroll(pList);
}

void GdbConsole::AppendString(const char* str)
{
	CListBox* pList = static_cast<CListBox*>(GetDlgItem(IDC_GDBSTDIO));
	ASSERT(pList != 0);
	int count = pList->GetCount();
	if (count == 0)
		pList->AddString(str);
	else	{
		CString txt;
		pList->GetText(--count, txt);
		pList->DeleteString(count);
		txt += str;
		pList->AddString(txt);
	}
	scroll(pList);
}

void GdbConsole::OnDestroy()
{
	theApp.SaveDialogWindowPosition("GdbWindow", this);
	CDialog::OnDestroy();
}

int GdbConsole::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;
	theApp.RestoreDialogWindowPosition("GdbWindow", this);
	return 0;
}

void GdbConsole::ClearConsole()
{
	CListBox* pList = static_cast<CListBox*>(GetDlgItem(IDC_GDBSTDIO));
	pList->ResetContent();
}

⌨️ 快捷键说明

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