// ZoneFile.cpp : implementation file // #include "stdafx.h" #include "msvc5ocr.h" #include "ZoneFile.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CZoneFile dialog CZoneFile::CZoneFile(BOOL bLoad, CWnd* pParent /*=NULL*/) : CDialog(CZoneFile::IDD, pParent) { //{{AFX_DATA_INIT(CZoneFile) // NOTE: the ClassWizard will add member initialization here m_csZoneFileName = _T(""); //}}AFX_DATA_INIT m_bLoad = bLoad; } void CZoneFile::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CZoneFile) DDX_Control(pDX, IDOK, m_btnOK); DDX_Control(pDX, IDC_EDIT_ZONE_FILE_NAME, m_edtFileName); DDX_Text(pDX, IDC_EDIT_ZONE_FILE_NAME, m_csZoneFileName); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CZoneFile, CDialog) //{{AFX_MSG_MAP(CZoneFile) ON_BN_CLICKED(IDC_BUTTON_BROWSE_ZONE, OnBrowseZone) ON_EN_CHANGE(IDC_EDIT_ZONE_FILE_NAME, OnChangeEditZoneFileName) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CZoneFile message handlers void CZoneFile::OnBrowseZone() { CFileDialog FileDlg(m_bLoad, _TEXT("ZON"), NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, _TEXT("Zone Files (*.ZON)|*.ZON|")); if (FileDlg.DoModal() == IDOK) m_edtFileName.SetWindowText(FileDlg.GetPathName()); } void CZoneFile::OnChangeEditZoneFileName() { CString csText; m_edtFileName.GetWindowText(csText); m_btnOK.EnableWindow(!csText.IsEmpty()); } BOOL CZoneFile::OnInitDialog() { CDialog::OnInitDialog(); SetWindowText(m_bLoad ? _TEXT("Load Zone File") : _TEXT("Export Zone File")); m_edtFileName.SetWindowText(_TEXT("")); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }