// UpdateDlg.cpp : implementation file
//

#include "stdafx.h"
#include "resource.h"
#include "UpdateDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CUpdateDlg dialog


CUpdateDlg::CUpdateDlg(CWnd* pParent /*=NULL*/)
	: CaplTranslateDialog(CUpdateDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CUpdateDlg)
	m_etalon_path = _T("");
	m_update_path = _T("");
	//}}AFX_DATA_INIT
	m_files=0;
	m_del_files=0;
	m_bNoCancel=FALSE;
}


void CUpdateDlg::DoDataExchange(CDataExchange* pDX)
{
	CaplTranslateDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CUpdateDlg)
	DDX_Control(pDX, IDOK, m_ok_btn);
	DDX_Control(pDX, IDC_FILELIST, m_file_list);
	DDX_Text(pDX, IDC_ETALON_PATH, m_etalon_path);
	DDX_Text(pDX, IDC_UPDATE_PATH, m_update_path);
	//}}AFX_DATA_MAP
	DDX_Control(pDX, IDCANCEL, m_cancel_btn);
}


BEGIN_MESSAGE_MAP(CUpdateDlg, CaplTranslateDialog)
	//{{AFX_MSG_MAP(CUpdateDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CUpdateDlg message handlers

BOOL CUpdateDlg::OnInitDialog() 
{
	CaplTranslateDialog::OnInitDialog();

	bool bOkEnabled=false;
	
	if(m_files!=0)
	{
		if(m_files->GetSize()>0)
		{
			m_ok_btn.EnableWindow(TRUE);
			bOkEnabled=true;
			for(int i=0;i<m_files->GetSize();i++)
				m_file_list.AddString(m_files->GetAt(i));
		}
	}
	if(m_del_files!=0)
	{
		if(m_del_files->GetSize()>0)
		{
			m_ok_btn.EnableWindow(TRUE);
			bOkEnabled=true;
			for(int i=0;i<m_del_files->GetSize();i++)
				m_file_list.AddString("{удалить}" + m_del_files->GetAt(i));
		}
	}
	if(m_bNoCancel && bOkEnabled) m_cancel_btn.EnableWindow(FALSE);  // Доп Защита от косяков

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
