ciderpress/app/CreateSubdirDialog.cpp
Andy McFadden 63b9996009 Normalize indentation and EOL
This updates all source files to use spaces instead of tabs for
indentation.  It also normalizes the end-of-line markers to be
Windows-style CRLF, and ensures that all files end with EOL.

No substantive changes were made; "diff -w" is empty.
2014-11-03 16:26:53 -08:00

83 lines
1.9 KiB
C++

/*
* CiderPress
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
* See the file LICENSE for distribution terms.
*/
/*
* Implementation of CreateSubdirDialog.
*
* Gets the name from the user, validates it against the supplied
* GenericArchive, and returns.
*/
#include "stdafx.h"
#include "CreateSubdirDialog.h"
BEGIN_MESSAGE_MAP(CreateSubdirDialog, CDialog)
ON_WM_HELPINFO()
END_MESSAGE_MAP()
/*
* Set up the control.
*/
BOOL
CreateSubdirDialog::OnInitDialog(void)
{
/* do the DoDataExchange stuff */
CDialog::OnInitDialog();
/* select the default text and set the focus */
CEdit* pEdit = (CEdit*) GetDlgItem(IDC_CREATESUBDIR_NEW);
ASSERT(pEdit != nil);
pEdit->SetSel(0, -1);
pEdit->SetFocus();
return FALSE; // we set the focus
}
/*
* Convert values.
*/
void
CreateSubdirDialog::DoDataExchange(CDataExchange* pDX)
{
CString msg, failed;
msg = "";
failed.LoadString(IDS_MB_APP_NAME);
/* put fNewName last so it gets the focus after failure */
DDX_Text(pDX, IDC_CREATESUBDIR_BASE, fBasePath);
DDX_Text(pDX, IDC_CREATESUBDIR_NEW, fNewName);
/* validate the path field */
if (pDX->m_bSaveAndValidate) {
if (fNewName.IsEmpty()) {
msg = "You must specify a new name.";
goto fail;
}
msg = fpArchive->TestPathName(fpParentEntry, fBasePath, fNewName,
'\0');
if (!msg.IsEmpty())
goto fail;
}
return;
fail:
ASSERT(!msg.IsEmpty());
MessageBox(msg, failed, MB_OK);
pDX->Fail();
return;
}
/*
* Context help request (question mark button).
*/
BOOL
CreateSubdirDialog::OnHelpInfo(HELPINFO* lpHelpInfo)
{
WinHelp((DWORD) lpHelpInfo->iCtrlId, HELP_CONTEXTPOPUP);
return TRUE; // yes, we handled it
}