// SevereErrDlg.cpp : implementation file
//

#include "stdafx.h"
#include "LocalErrors.h"
#include "SevereErrDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSevereErrDlg dialog

CSevereErrDlg::CSevereErrDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSevereErrDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSevereErrDlg)
	m_csComments = _T("");
	m_csCorrectiveAction = _T("");
	m_csResults = _T("");
	m_csWhatHappened = _T("");
	//}}AFX_DATA_INIT
	m_csCaption = _T("");
}

void CSevereErrDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSevereErrDlg)
	DDX_Control(pDX, IDD_WHAT_HAPPENED, m_btnCaption_WhatHappened);
	DDX_Control(pDX, IDD_RESULTS, m_btnCaption_Results);
	DDX_Control(pDX, IDD_CORRECTIVE_ACTION, m_btnCaption_CorrectiveAction);
	DDX_Control(pDX, IDD_COMMENTS, m_btnCaption_Comments);
	DDX_Text(pDX, IDC_COMMENTS, m_csComments);
	DDX_Text(pDX, IDC_CORRECTIVE_ACTION, m_csCorrectiveAction);
	DDX_Text(pDX, IDC_RESULTS, m_csResults);
	DDX_Text(pDX, IDC_WHAT_HAPPENED, m_csWhatHappened);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CSevereErrDlg, CDialog)
	//{{AFX_MSG_MAP(CSevereErrDlg)
	ON_BN_CLICKED(IDC_REPORT_ERROR, OnReportError)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSevereErrDlg message handlers

BOOL CSevereErrDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	if( ! m_csCaption_WhatHappened.IsEmpty() )
		m_btnCaption_WhatHappened.SetWindowText( m_csCaption_WhatHappened );
	if( ! m_csCaption_CorrectiveAction.IsEmpty() )
		m_btnCaption_CorrectiveAction.SetWindowText( m_csCaption_CorrectiveAction );
	if( ! m_csCaption_Results.IsEmpty() )
		m_btnCaption_Results.SetWindowText( m_csCaption_Results );
	if( ! m_csCaption_Comments.IsEmpty() )
		m_btnCaption_Comments.SetWindowText( m_csCaption_Comments );
	if( m_csCaption ) SetWindowText( m_csCaption );
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSevereErrDlg::OnOK() 
{
	m_nResult = RESULT_OK;					// report RESULT_OK
	CDialog::OnOK();
}

void CSevereErrDlg::OnReportError() 
{
	m_nResult = RESULT_REPORT_ERROR;		// report RESULT_REPORT_ERROR
	CDialog::OnOK();
}

void CSevereErrDlg::OnCancel() 
{
	m_nResult = RESULT_CANCEL;				// report RESULT_CANCEL
	CDialog::OnCancel();
}

