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

📄 message.cpp

📁 整个工作过程主要划分成词法分析阶段、语法分析阶段、中间代码生成和目标代码生成四个部分。 第一阶段是把输入的字符串形式的源程序分割成一个个单词符号。 第二阶段是识别由词法分析给出的单词符号序列在
💻 CPP
字号:
// Message.cpp : implementation file
//

#include "stdafx.h"
#include "lulu.h"
#include "Message.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMessage

CWnd* CMessage::m_pWndInfo;
CWnd* CMessage::m_pWndStatusInfo;

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMessage::CMessage()
{

}

CMessage::~CMessage()
{

}

void CMessage::SetStatusWnd(CWnd *pWnd)
{
	m_pWndStatusInfo=pWnd;
}

void CMessage::SetOutputWnd(CWnd *pWnd)
{
	m_pWndInfo=pWnd;
}

void CMessage::PrintError(CString strInfo)
{
	if(m_pWndInfo!=NULL)
	{
		CString str;
		m_pWndInfo->GetWindowText(str);
		str+="------------------error-----------------\r\n";
		str=str+strInfo+"\r\n";
		m_pWndInfo->SetWindowText(str);
		CEditView *pView=(CEditView*)m_pWndInfo;
		CEdit& edit=pView->GetEditCtrl();
		edit.LineScroll(edit.GetLineCount(), 0);
	}
}

void CMessage::PrintInfo(CString strInfo)
{
	if(m_pWndInfo!=NULL)
	{
		CString str;
		m_pWndInfo->GetWindowText(str);
		str=str+strInfo+"\r\n";
		m_pWndInfo->SetWindowText(str);
		CEditView *pView=(CEditView*)m_pWndInfo;
		CEdit& edit=pView->GetEditCtrl();
		edit.LineScroll(edit.GetLineCount(), 0);
	}
}

void CMessage::PrintStatusInfo(CString strInfo)
{
	if (m_pWndStatusInfo!=NULL)
		m_pWndStatusInfo->SetWindowText(strInfo);
}

void CMessage::ClearInfo()
{
	if(m_pWndInfo!=NULL)
	{
		m_pWndInfo->SetWindowText("");
		m_pWndStatusInfo->SetWindowText("");
	}
}


BEGIN_MESSAGE_MAP(CMessage, CWnd)
	//{{AFX_MSG_MAP(CMessage)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMessage message handlers

⌨️ 快捷键说明

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