ciderpress/app/DEFileDialog.cpp

52 lines
1.2 KiB
C++
Raw Normal View History

2007-03-27 17:47:10 +00:00
/*
* CiderPress
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
* See the file LICENSE for distribution terms.
*/
/*
* Implementation of Disk Editor "open file" dialog.
*/
#include "stdafx.h"
#include "DEFileDialog.h"
BEGIN_MESSAGE_MAP(DEFileDialog, CDialog)
ON_EN_CHANGE(IDC_DEFILE_FILENAME, OnChange)
ON_WM_HELPINFO()
2007-03-27 17:47:10 +00:00
END_MESSAGE_MAP()
BOOL DEFileDialog::OnInitDialog(void)
2007-03-27 17:47:10 +00:00
{
CWnd* pWnd = GetDlgItem(IDOK);
2014-11-18 05:13:13 +00:00
ASSERT(pWnd != NULL);
pWnd->EnableWindow(FALSE);
2007-03-27 17:47:10 +00:00
return CDialog::OnInitDialog();
2007-03-27 17:47:10 +00:00
}
void DEFileDialog::DoDataExchange(CDataExchange* pDX)
2007-03-27 17:47:10 +00:00
{
DDX_Text(pDX, IDC_DEFILE_FILENAME, fName);
DDX_Check(pDX, IDC_DEFILE_RSRC, fOpenRsrcFork);
2007-03-27 17:47:10 +00:00
}
void DEFileDialog::OnChange(void)
2007-03-27 17:47:10 +00:00
{
CEdit* pEdit = (CEdit*) GetDlgItem(IDC_DEFILE_FILENAME);
2014-11-18 05:13:13 +00:00
ASSERT(pEdit != NULL);
2007-03-27 17:47:10 +00:00
CString str;
pEdit->GetWindowText(str);
//LOGI("STR is '%ls' (%d)", str, str.GetLength());
2007-03-27 17:47:10 +00:00
CWnd* pWnd = GetDlgItem(IDOK);
2014-11-18 05:13:13 +00:00
ASSERT(pWnd != NULL);
pWnd->EnableWindow(!str.IsEmpty());
2007-03-27 17:47:10 +00:00
}
BOOL DEFileDialog::OnHelpInfo(HELPINFO* lpHelpInfo)
2007-03-27 17:47:10 +00:00
{
WinHelp((DWORD) lpHelpInfo->iCtrlId, HELP_CONTEXTPOPUP);
return TRUE; // yes, we handled it
2007-03-27 17:47:10 +00:00
}