Files
envi-code/SourceCode/Code2026/shsTK/NewDirDlg.cpp
T

68 lines
1.5 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
// NewDirDlg.cpp : implementation file
2026-09-28 15:28:50 +08:00
//
#include "stdafx.h"
#include "NewDirDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNewDirDlg dialog
CNewDirDlg::CNewDirDlg(CWnd* pParent /*=NULL*/)
: CDialog(CNewDirDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewDirDlg)
m_sFolderName = _T("");
//}}AFX_DATA_INIT
m_nType=0;
}
void CNewDirDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNewDirDlg)
DDX_Text(pDX, IDC_FOLDERNAME, m_sFolderName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNewDirDlg, CDialog)
//{{AFX_MSG_MAP(CNewDirDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CNewDirDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
m_sFolderName.TrimLeft();
m_sFolderName.TrimRight();
if(m_sFolderName.IsEmpty())
{
2026-10-04 00:04:20 +08:00
AfxMessageBox(_T("名称不能为空"));
2026-09-28 15:28:50 +08:00
return;
}
int nIndex=-1;
if(BaseFuncs::FindStringInArr(m_strDwgArray,m_sFolderName,nIndex))
{
2026-10-04 00:04:20 +08:00
AfxMessageBox(_T("目录已经存在"));
2026-09-28 15:28:50 +08:00
return;
}
UpdateData(FALSE);
CDialog::OnOK();
}
BOOL CNewDirDlg::OnInitDialog()
{
CDialog::OnInitDialog();
if(m_nType==1)
{
2026-10-04 00:04:20 +08:00
GetDlgItem(IDC_STATICDIR)->SetWindowText(_T("文件名称"));
SetWindowText(_T("新建文件"));
2026-09-28 15:28:50 +08:00
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}