// ApplyToAll.cpp : implementation file
//

#include "stdafx.h"
#include "apl_api.h"
#include "ApplyToAll.h"

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

/////////////////////////////////////////////////////////////////////////////
// CApplyToAllDlg dialog


CApplyToAllDlg::CApplyToAllDlg(CWnd* pParent /*=NULL*/)
	: CaplTranslateDialog(CApplyToAllDlg::IDD, pParent)
{
	m_title=_T("PSM");
	m_apply_to_all_enabled=true;
	//{{AFX_DATA_INIT(CApplyToAllDlg)
	m_question = _T("");
	m_apply_to_all = FALSE;
	//}}AFX_DATA_INIT
}


void CApplyToAllDlg::DoDataExchange(CDataExchange* pDX)
{
	CaplTranslateDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CApplyToAllDlg)
	DDX_Control(pDX, IDC_APPLY_TO_ALL, m_apply_to_all_ctrl);
	DDX_Control(pDX, IDOK, m_ok_btn);
	DDX_Control(pDX, IDCANCEL, m_cancel_btn);
	DDX_Text(pDX, IDC_QUESTION, m_question);
	DDX_Check(pDX, IDC_APPLY_TO_ALL, m_apply_to_all);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CApplyToAllDlg message handlers

BOOL CApplyToAllDlg::OnInitDialog() 
{
	CaplTranslateDialog::OnInitDialog();
	m_cancel_btn.SetIcon(GetAplStdIco16(APLSTDICO_CANCEL));
	m_cancel_btn.SetFlat(FALSE);
	m_ok_btn.SetIcon(GetAplStdIco16(APLSTDICO_OK));
	m_ok_btn.SetFlat(FALSE);
	// TODO: Add extra initialization here
	SetWindowText(m_title);
	if(!m_apply_to_all_enabled) m_apply_to_all_ctrl.EnableWindow(false); 
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CApplyToAllDlg::OnOK() 
{
	// TODO: Add extra validation here
	if(!UpdateData()) return;

	CaplTranslateDialog::OnOK();
}

void CApplyToAllDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	UpdateData();	
	CaplTranslateDialog::OnCancel();
}
