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

📄 tianlei.cpp

📁 一个基于C++语言的简单学籍管理系统
💻 CPP
字号:
// TianLei.cpp : implementation file
//

#include "stdafx.h"
#include "ClassEntryLink.h"
#include "TianLei.h"
#include "lassEntry.h"

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

/////////////////////////////////////////////////////////////////////////////
// TianLei dialog


TianLei::TianLei(CWnd* pParent /*=NULL*/)
	: CDialog(TianLei::IDD, pParent)
{
	//{{AFX_DATA_INIT(TianLei)
	m_name = _T("");
	m_fname = _T("");
	//}}AFX_DATA_INIT
}


void TianLei::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(TianLei)
	DDX_Control(pDX, IDC_COMBO1, m_combox);
	DDX_Text(pDX, IDC_EDIT1, m_name);
	DDX_CBString(pDX, IDC_COMBO1, m_fname);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(TianLei, CDialog)
	//{{AFX_MSG_MAP(TianLei)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// TianLei message handlers

void TianLei::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData();
	POSITION pos = m_pDoc->m_classlst.GetHeadPosition();

	while(pos)
	{
		
		ClassEntry* p = (ClassEntry*)m_pDoc->m_classlst.GetNext(pos);
		if(p->m_name==m_name)
		{
			AfxMessageBox("This class already exists");
			return;
		}
	}
	ClassEntry* pentry;
	pentry = new ClassEntry;
	pentry->m_name=m_name;
	pentry->m_father=m_fname;
	m_pDoc->m_classlst.AddTail(pentry);
	CDialog::OnOK();
}

BOOL TianLei::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	
	POSITION pos = m_pDoc->m_classlst.GetHeadPosition();

	while(pos)
	{
		ClassEntry* p = (ClassEntry*)m_pDoc->m_classlst.GetNext(pos);
		m_combox.AddString(p->m_name);
	} 
	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 + -