newdlg.cpp

来自「编译原理课程」· C++ 代码 · 共 88 行

CPP
88
字号
// newDlg.cpp : implementation file
//

#include "stdafx.h"
#include "analyzer.h"
#include "newDlg.h"
#include "analyzerDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// newDlg dialog


newDlg::newDlg(CWnd* pParent /*=NULL*/)
	: CDialog(newDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(newDlg)
	m_Edit = _T("");
	//}}AFX_DATA_INIT
}


void newDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(newDlg)
	DDX_Text(pDX, IDC_EDIT1, m_Edit);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(newDlg, CDialog)
	//{{AFX_MSG_MAP(newDlg)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// newDlg message handlers

void newDlg::showTable()
{
	m_Edit="";
	CString str="";
	CAnalyzerDlg   *p=(CAnalyzerDlg   *)this->GetParent();//.OnInitDialog();   
	//p->DestroyWindow();   
	//this->DestroyWindow();  
	//str=analyzerDlg.s_str;
	str=p->showKeyWord();   
	m_Edit=str;
	UpdateData(false);
}

void newDlg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	showTable();
}

void newDlg::OnButton2() 
{
	// TODO: Add your control notification handler code here
	CString str="";
	m_Edit="";
	CAnalyzerDlg   *p=(CAnalyzerDlg   *)this->GetParent();
	str=p->showID();   
	m_Edit=str;
	UpdateData(false);
}

void newDlg::OnButton3() 
{
	// TODO: Add your control notification handler code here
	CString str="";
	m_Edit="";
	CAnalyzerDlg   *p=(CAnalyzerDlg   *)this->GetParent();
	str=p->showConst();   
	m_Edit=str;
	UpdateData(false);
}

⌨️ 快捷键说明

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