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

📄 prop2.cpp

📁 这个是我用mfc写的一个pl0的编译器
💻 CPP
字号:
// prop2.cpp : implementation file
//

#include "stdafx.h"
#include "MFCpl0.h"
#include "prop2.h"
#include "Afx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Cprop2 property page

IMPLEMENT_DYNCREATE(Cprop2, CPropertyPage)

Cprop2::Cprop2() : CPropertyPage(Cprop2::IDD)
{
	//{{AFX_DATA_INIT(Cprop2)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

Cprop2::~Cprop2()
{
}

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


BEGIN_MESSAGE_MAP(Cprop2, CPropertyPage)
	//{{AFX_MSG_MAP(Cprop2)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Cprop2 message handlers

BOOL Cprop2::OnSetActive() 
{
	// TODO: Add your specialized code here and/or call the base class
	((CPropertySheet*)GetParent())->SetWizardButtons(PSWIZB_DISABLEDFINISH );
	CListBox* listbox;
	listbox=(CListBox*)(GetDlgItem(IDC_LIST1));
	CString temps;
//	int tempid;
	for(int i=0;i<txmax;i++)
	{
	
		if(table[i].kind==constant)
		{
			temps.Format("%d%s%s",i,"              const             ",table[i].name);
		}
		else if(table[i].kind==variable)
		{
			temps.Format("%d%s%s",i,"              var               ",table[i].name);
		}
		else if(table[i].kind==procedur)
		{
			temps.Format("%d%s%s",i,"               proc             ",table[i].name);
		}
		else
		{
			continue;
		}
		
		listbox->AddString(temps);

	}
	//listbox->AddString("jiusni ");
//	MessageBox("show");
	return CPropertyPage::OnSetActive();
}

void Cprop2::Addmsg(tablestruct table1[])
{
	for(int i=0;i<txmax;i++)
	{
		table[i]=table1[i];
	}
}

⌨️ 快捷键说明

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