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

📄 mydialog.cpp

📁 书上找到的
💻 CPP
字号:
// MyDialog.cpp : implementation file
//

#include "stdafx.h"
#include "毕业设计数字逻辑电子仿真器.h"
#include "MyDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyDialog dialog


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


void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMyDialog)
	DDX_Control(pDX, IDC_Output, m_OutputList);
	DDX_Text(pDX, IDC_MYSTATIC, m_MyCaption);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
	//{{AFX_MSG_MAP(CMyDialog)
	ON_LBN_SELCHANGE(IDC_Output, OnSelchangeOutput)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyDialog message handlers

void CMyDialog::OnSelchangeOutput() 
{
	// TODO: Add your control notification handler code here
	
}

BOOL CMyDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	//引用view.cpp中的x,计算要循环的次数以加入列表框
	extern int x;
	//引用view.cpp中的strs,用于加入字符串到列表框
	extern CArray<CString,CString&> strs;
	//引用view.cpp中的输入结点个数n
	extern int n;
	
	//开始加入字符串到列表框
	for(int i=0;i<x;i++)
	{
		m_OutputList.AddString (strs[i]);
	}
	//定义一个CString str用于格式化字符串
	m_MyCaption="输入端:";
	CString str;
	for(i=1;i<=n;i++)
	{
		str.Format("%d ",i);
		m_MyCaption+=str;
	}
	str.Format ("\t输出端");
	m_MyCaption+=str;
	
	UpdateData(FALSE);
	

		
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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