// NonCritDlg.cpp : implementation file
//

#include "stdafx.h"
#include "LocalErrors.h"
#include "NonCritDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CNonCritDlg dialog


CNonCritDlg::CNonCritDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CNonCritDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNonCritDlg)
	m_csComments = _T("");
	m_csCorrectiveAction = _T("");
	m_csResults = _T("");
	m_csWhatHappened = _T("");
	//}}AFX_DATA_INIT
	m_csCaption = _T("");
}


void CNonCritDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNonCritDlg)
	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(CNonCritDlg, CDialog)
	//{{AFX_MSG_MAP(CNonCritDlg)
	ON_BN_CLICKED(IDC_LOG_LOCAL, OnLogLocal)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNonCritDlg message handlers

BOOL CNonCritDlg::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 CNonCritDlg::OnOK() 
{
	m_nResult = RESULT_OK;				// report RESULT_OK as the result
	CDialog::OnOK();
}

void CNonCritDlg::OnLogLocal() 
{
	m_nResult = RESULT_LOG_LOCAL;		// report RESULT_LOG_LOCAL as the result
	CDialog::OnOK();
}

void CNonCritDlg::OnCancel() 
{
	m_nResult = RESULT_CANCEL;			// report RESULT_CANCEL as the result
	CDialog::OnCancel();
}

