📄 deptdialog.cpp
字号:
// DeptDialog.cpp : Implementation of CDeptDialog
#include "stdafx.h"
#include "DeptDialog.h"
/////////////////////////////////////////////////////////////////////////////
// CDeptDialog
void CDeptDialog::UpdateData(BOOL bSaveChangesToSet)
{
if (bSaveChangesToSet) {
//Read From Screen
GetDlgItemText(IDC_CODE,
(char *) m_pSet[0][m_nCurrentRow].m_DepartmentCode, 5);
GetDlgItemText(IDC_NAME,
(char *) m_pSet[0][m_nCurrentRow].m_DepartmentName, 51);
}
else {
//Write to Screen
SetDlgItemText(IDC_CODE,
(char *) m_pSet[0][m_nCurrentRow].m_DepartmentCode);
SetDlgItemText(IDC_NAME,
(char *) m_pSet[0][m_nCurrentRow].m_DepartmentName);
}
}
void CDeptDialog::OnMove(CPosition position)
{
UpdateData(TRUE); //Read from screen
DisplayStatus("");
switch (position) {
case (FIRST) :
m_nCurrentRow = 0;
break;
case (NEXT) :
m_nCurrentRow++;
if (m_nCurrentRow > m_nMaxRows) { //EOF
m_nCurrentRow = m_nMaxRows;
DisplayStatus("Last record reached.");
}
break;
case (LAST) :
m_nCurrentRow = m_nMaxRows;
break;
case (PREV) :
m_nCurrentRow--;
if (m_nCurrentRow < 0) { //BOF
m_nCurrentRow = 0;
DisplayStatus("First record reached.");
}
break;
}
UpdateData(FALSE); //Update Screen
}
void CDeptDialog::DisplayStatus(char *strMessage)
{
SetDlgItemText(IDC_STATUS, strMessage);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -