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

📄 xianshi.cpp

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

#include "stdafx.h"
#include "ClassEntryLink.h"
#include "Xianshi.h"
#include "S.h"
#include "Hanshu.h"
#include "XianHanshu.h"

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

/////////////////////////////////////////////////////////////////////////////
// Xianshi dialog


Xianshi::Xianshi(CWnd* pParent /*=NULL*/)
	: CDialog(Xianshi::IDD, pParent)
{
	//{{AFX_DATA_INIT(Xianshi)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void Xianshi::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Xianshi)
	DDX_Control(pDX, IDC_LIST1, m_listbox);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Xianshi, CDialog)
	//{{AFX_MSG_MAP(Xianshi)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_LBN_DBLCLK(IDC_LIST1, OnDblclkList1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Xianshi message handlers

void Xianshi::OnButton1() 
{
	// TODO: Add your control notification handler code here
	int icus=m_listbox.GetCurSel();
	if(icus<0) return;
	CString s;
	m_listbox.GetText(icus,s);

	POSITION pos = m_pDoc->m_classlst.GetHeadPosition();

	/*while(pos)
	{
		
		ClassEntry* p = (ClassEntry*)m_pDoc->m_classlst.GetNext(pos);
		if(p->m_name==s)
		{
		
			m_pDoc->m_classlst.RemoveAt(pos1);
			delete p;
		}
	}*/ 
	ClassEntry* p=NULL;
	while(pos)
	{
		
		p = (ClassEntry*)m_pDoc->m_classlst.GetNext(pos);
		if(p->m_name==s)
		{
		
			break;
		}
	}
	XianHanshu dlg;
	dlg.m_str=s;
	dlg.m_pClass=p;
	dlg.DoModal();
}

void Xianshi::OnDblclkList1()
{
	// TODO: Add your control notification handler code here
	
}

BOOL Xianshi::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_listbox.AddString(p->m_name);
	} 
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void Xianshi::OnButton2() 
{
	// TODO: Add your control notification handler code here
	int icus=m_listbox.GetCurSel();
	if(icus<0) return;
	CString str;
	m_listbox.GetText(icus,str);
	S s;
	s.m_pDoc=m_pDoc;
	s.m_str=str;
	s.DoModal();

}

void Xianshi::OnButton3() 
{
	// TODO: Add your control notification handler code here
	int icus=m_listbox.GetCurSel();
	if(icus<0) return;
	CString str;
	m_listbox.GetText(icus,str);
	Hanshu hs;
	hs.m_pDoc=m_pDoc;
	hs.m_str=str;
	hs.DoModal();
}

⌨️ 快捷键说明

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