зеркало из https://github.com/mozilla/pjs.git
Validation for .nci in the entry field during creation of NCI files
This commit is contained in:
Родитель
ce191ed5b1
Коммит
5daa1b787d
|
@ -47,9 +47,25 @@ void CNewDialog::DoDataExchange(CDataExchange* pDX)
|
|||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CNewDialog)
|
||||
DDX_Text(pDX, IDC_EDIT1, m_EditField);
|
||||
DDV_INIFile(pDX, m_EditField);
|
||||
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
void CNewDialog::DDV_INIFile(CDataExchange* pDX, CString value)
|
||||
{
|
||||
if(pDX->m_bSaveAndValidate)
|
||||
{
|
||||
if(value.Right(4) != ".nci")
|
||||
{
|
||||
value = value +".nci";
|
||||
CWnd nbox;
|
||||
nbox.MessageBox("We have appended '.nci' to the file" ,"value",MB_ICONEXCLAMATION);
|
||||
}
|
||||
myData = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CNewDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CNewDialog)
|
||||
|
@ -80,8 +96,8 @@ BOOL CNewDialog::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||
void CNewDialog::OnOK()
|
||||
{
|
||||
// TODO: Add extra validation here
|
||||
UpdateData();
|
||||
myData = m_EditField;
|
||||
// UpdateData();
|
||||
// myData = m_EditField;
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
|
||||
CString myData;
|
||||
CString GetData();
|
||||
void DDV_INIFile(CDataExchange* pDX, CString value);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
|
|
Загрузка…
Ссылка в новой задаче