dialog3.cpp
来自「实现了简单的Simple语言的编辑器,包括词法分析,语法分析,生成四元式,以及生」· C++ 代码 · 共 80 行
CPP
80 行
// Dialog3.cpp : implementation file
//
#include "stdafx.h"
#include "caoyuting.h"
#include "Dialog3.h"
#include "Dialog1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CCaoyutingApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CDialog3 dialog
CDialog3::CDialog3(CWnd* pParent /*=NULL*/)
: CDialog(CDialog3::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialog3)
m_str = _T("");
//}}AFX_DATA_INIT
}
void CDialog3::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialog3)
DDX_Control(pDX, IDC_LIST, m_cOut);
DDX_LBString(pDX, IDC_LIST, m_str);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialog3, CDialog)
//{{AFX_MSG_MAP(CDialog3)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialog3 message handlers
void CDialog3::OnCancel()
{
// TODO: Add extra cleanup here
CDialog1 dialog;
int nIndex;
UpdateData(true);
for(int i=0;i<theApp.n;i++)
if(m_str==theApp.nam[i])
nIndex=dialog.m_cOut.GetCurSel();
delete dialog.m_cOut.GetItemDataPtr(nIndex);
CDialog::OnCancel();
}
BOOL CDialog3::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CString str1;
str1.Format("type val name ");
m_cOut.AddString(str1);
m_cOut.AddString(theApp.str1);
m_str=str1+theApp.str1;
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDialog3::OnButton1()
{
// TODO: Add your control notification handler code here
CDialog3::OnOK();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?