📄 scoredlg.cpp
字号:
// ScoreDlg.cpp : implementation file
//
#include "stdafx.h"
#include "S2009072032.h"
#include "ScoreDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScoreDlg dialog
CScoreDlg::CScoreDlg(CWnd* pParent /*=NULL*/)
: CDialog(CScoreDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CScoreDlg)
m_strCourseNO = _T("");
m_strStuNO = _T("");
m_fCredit = 0.0f;
m_fScore = 0.0f;
//}}AFX_DATA_INIT
}
void CScoreDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CScoreDlg)
DDX_Text(pDX, IDC_EDIT_COURSENO, m_strCourseNO);
DDV_MaxChars(pDX, m_strCourseNO, 7);
DDX_Text(pDX, IDC_EDIT_STUNO, m_strStuNO);
DDV_MaxChars(pDX, m_strStuNO, 20);
DDX_Text(pDX, IDC_EDIT_CREDIT, m_fCredit);
DDV_MinMaxFloat(pDX, m_fCredit, 0.f, 10.f);
DDX_Text(pDX, IDC_EDIT_STUSCORE, m_fScore);
DDV_MinMaxFloat(pDX, m_fScore, 0.f, 100.f);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CScoreDlg, CDialog)
//{{AFX_MSG_MAP(CScoreDlg)
ON_EN_CHANGE(IDC_EDIT_COURSENO, OnChangeEditCourseno)
ON_EN_CHANGE(IDC_EDIT_CREDIT, OnChangeEditCredit)
ON_EN_CHANGE(IDC_EDIT_STUNO, OnChangeEditStuno)
ON_EN_CHANGE(IDC_EDIT_STUSCORE, OnChangeEditStuscore)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScoreDlg message handlers
void CScoreDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData();
m_strStuNO.TrimLeft();
m_strCourseNO.TrimLeft();
if(m_strStuNO.IsEmpty())
MessageBox("学号不能为空!");
else
if(m_strCourseNO.IsEmpty())
MessageBox("课程号不能为空!");
else
CDialog::OnOK();
}
BOOL CScoreDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_strOKText.TrimLeft();
GetDlgItem(IDOK)->SetWindowText(m_strOKText);
if(m_strOKText=="修改")
{
GetDlgItem(IDC_EDIT_STUNO)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_COURSENO)->EnableWindow(FALSE);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CScoreDlg::OnChangeEditCourseno()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CScoreDlg::OnChangeEditCredit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CScoreDlg::OnChangeEditStuno()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CScoreDlg::OnChangeEditStuscore()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -