prop5.cpp

来自「这个是我用mfc写的一个pl0的编译器」· C++ 代码 · 共 92 行

CPP
92
字号
// prop5.cpp : implementation file
//

#include "stdafx.h"
#include "MFCpl0.h"
#include "prop5.h"

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

/////////////////////////////////////////////////////////////////////////////
// Cprop5 property page

IMPLEMENT_DYNCREATE(Cprop5, CPropertyPage)

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

Cprop5::~Cprop5()
{
}

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


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

/////////////////////////////////////////////////////////////////////////////
// Cprop5 message handlers

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

BOOL Cprop5::OnSetActive() 
{
	((CPropertySheet*)GetParent())->SetWizardButtons(PSWIZB_DISABLEDFINISH );
	CListBox* listbox;
	listbox=(CListBox*)(GetDlgItem(IDC_LIST1));
	listbox->ResetContent();
	CString temps;
//	int tempid;
	for(int i=0;i<txmax;i++)
	{
	
		if(table[i].kind==constant)
		{
			temps.Format("%3d%s%s",i,"              const             ",table[i].name);
		}
		else if(table[i].kind==variable)
		{
			temps.Format("%3d%s%s",i,"              var               ",table[i].name);
		}
		else if(table[i].kind==procedur)
		{
			temps.Format("%3d%s%s",i,"               proc             ",table[i].name);
		}
		else
		{
			continue;
		}
	//	listbox->InsertString(i,temps);
		listbox->AddString(temps);

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

⌨️ 快捷键说明

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