Files
envi-code/SourceCode/Code2026/shsTK/RnameBlkDlg.cpp
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

84 lines
1.8 KiB
C++

// RnameBlkDlg.cpp : implementation file
//
#include "stdafx.h"
#include "RnameBlkDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRnameBlkDlg dialog
CRnameBlkDlg::CRnameBlkDlg(CWnd* pParent /*=NULL*/)
: CDialog(CRnameBlkDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRnameBlkDlg)
m_sNewBlockName = _T("");
m_sOldBlkName = _T("");
//}}AFX_DATA_INIT
}
void CRnameBlkDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRnameBlkDlg)
DDX_Text(pDX, IDC_NEWBLOCKNAME, m_sNewBlockName);
DDX_Text(pDX, IDC_OLDBLOCKNAME, m_sOldBlkName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRnameBlkDlg, CDialog)
//{{AFX_MSG_MAP(CRnameBlkDlg)
ON_EN_CHANGE(IDC_NEWBLOCKNAME, OnChangeNewblockname)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRnameBlkDlg message handlers
void CRnameBlkDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
m_sNewBlockName.TrimLeft();
m_sNewBlockName.TrimRight();
if(m_sNewBlockName.IsEmpty())
{
AfxMessageBox(_T("不能为空"));
return;
}
int nIndex;
if(BaseFuncs::FindStringInArr(m_strRcdNames,m_sNewBlockName,nIndex))
{
AfxMessageBox(_T("该名称已经存在"));
return;
}
CDialog::OnOK();
}
void CRnameBlkDlg::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
void CRnameBlkDlg::OnChangeNewblockname()
{
// 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
UpdateData(TRUE);
}