	// Dlg_SecHeating.cpp : implementation file
//

#include "stdafx.h"
#include "SAPP1.h"
#include "SAPP1Dlg.h"
#include "Dlg_SecHeating.h"

// CDlg_SecHeating dialog

IMPLEMENT_DYNAMIC(CDlg_SecHeating, CDialog)
CDlg_SecHeating::CDlg_SecHeating(CWnd* pParent /*=NULL*/)
	: CDialog(CDlg_SecHeating::IDD, pParent)
	, str_comboIsSecHtPresent(_T(""))
	, str_comboOpenFlueOrChimney(_T(""))
	, str_comboUnconnectedGasPoint(_T(""))
	, str_comboEffFrom(_T(""))
	, str_comboFuel(_T(""))
	, str_comboSystem(_T(""))
	, str_editManufactDesc(_T(""))
	, str_comboTestMethod(_T(""))
	, str_editEff(_T(""))
	, str_editSecHtFraction(_T(""))
{
}

CDlg_SecHeating::~CDlg_SecHeating()
{
}

void CDlg_SecHeating::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_STATIC_1, m_labelGeneral);
	DDX_Control(pDX, IDC_COMBO_IsSecHtPresent, m_comboIsSecHtPresent);
	DDX_Control(pDX, IDC_COMBO_IsThereOpenFlueChimney, m_comboOpenFlueOrChimney);
	DDX_Control(pDX, IDC_COMBO_IsThereUnconnectedGasPoint, m_comboUnconnectedGasPoint);
	DDX_Control(pDX, IDC_COMBO_EffFrom, m_comboEffFrom);
	DDX_Control(pDX, IDC_COMBO_Fuel, m_comboFuel);
	DDX_Control(pDX, IDC_COMBO_system, m_comboSystem);
	DDX_Control(pDX, IDC_COMBO_testMethod, m_comboTestMethod);
	DDX_Control(pDX, IDC_EDIT_ManufactDesc, m_editManufactDesc);
	DDX_Control(pDX, IDC_EDIT_eff, m_editEff);
	DDX_CBString(pDX, IDC_COMBO_IsSecHtPresent, str_comboIsSecHtPresent);
	DDX_CBString(pDX, IDC_COMBO_IsThereOpenFlueChimney, str_comboOpenFlueOrChimney);
	DDX_CBString(pDX, IDC_COMBO_IsThereUnconnectedGasPoint, str_comboUnconnectedGasPoint);
	DDX_CBString(pDX, IDC_COMBO_EffFrom, str_comboEffFrom);
	DDX_CBString(pDX, IDC_COMBO_Fuel, str_comboFuel);
	DDX_CBString(pDX, IDC_COMBO_system, str_comboSystem);
	DDX_Text(pDX, IDC_EDIT_ManufactDesc, str_editManufactDesc);
	DDX_CBString(pDX, IDC_COMBO_testMethod, str_comboTestMethod);
	DDX_Text(pDX, IDC_EDIT_eff, str_editEff);
	DDX_Control(pDX, IDC_EDIT1, m_editSecHtFraction);
	DDX_Text(pDX, IDC_EDIT1, str_editSecHtFraction);
	DDX_Control(pDX, IDC_STATIC_secHt, m_labelSecHtFraction);
}

BEGIN_MESSAGE_MAP(CDlg_SecHeating, CDialog)
	ON_CBN_SELCHANGE(IDC_COMBO_IsSecHtPresent, OnCbnSelchangeComboIssechtpresent)
	ON_CBN_SELCHANGE(IDC_COMBO_IsThereOpenFlueChimney, OnCbnSelchangeComboIsthereopenfluechimney)
	ON_CBN_SELCHANGE(IDC_COMBO_IsThereUnconnectedGasPoint, OnCbnSelchangeComboIsthereunconnectedgaspoint)
	ON_CBN_SELCHANGE(IDC_COMBO_EffFrom, OnCbnSelchangeComboEfffrom)
	ON_CBN_SELCHANGE(IDC_COMBO_Fuel, OnCbnSelchangeComboFuel)
	ON_CBN_SELCHANGE(IDC_COMBO_system, OnCbnSelchangeCombosystem)
	ON_EN_CHANGE(IDC_EDIT_ManufactDesc, OnEnChangeEditManufactdesc)
	ON_CBN_SELCHANGE(IDC_COMBO_testMethod, OnCbnSelchangeCombotestmethod)
	ON_EN_CHANGE(IDC_EDIT_eff, OnEnChangeEditeff)
	ON_EN_CHANGE(IDC_EDIT1, OnEnChangeEdit1)
END_MESSAGE_MAP()

// CDlg_SecHeating message handlers

BOOL CDlg_SecHeating::OnInitDialog()
{
	CDialog::OnInitDialog();

	//---------------------------------------------------
	// LABELS
	//---------------------------------------------------
	CFont *m_Font1 = new CFont;
	m_Font1->CreatePointFont(90, "Arial Bold");

	m_labelGeneral.SetFont(m_Font1); 
	m_labelGeneral.SetTextColor(BLUE);

	//m_labelSecHtFraction.SetFont(m_Font1); 
	m_labelSecHtFraction.SetTextColor(BLUE);

	//---------------------------------------------------
	// DROP DOWN MENU
	//---------------------------------------------------
	AddStringsToComboBoxesForSecHeatingDlg();

	if(file_new_selected ==true)
	{
		SetAllValuesToDefault();		
	}

	DisplayValuesForSecHeatingDlg();
		
	//---------------------------------------------------
	// Set controls to editable/non-editable
	//---------------------------------------------------
	if( secHtEffFrom == "SAP default")
	{
		m_editEff.SetReadOnly(TRUE);
	}
	else
	{
		m_editEff.SetReadOnly(FALSE);
	}

	return TRUE;
}

void CDlg_SecHeating::AddStringsToComboBoxesForSecHeatingDlg()
{
	m_comboIsSecHtPresent.InsertString(0,"No");
	m_comboIsSecHtPresent.InsertString(1,"Yes");

	m_comboOpenFlueOrChimney.InsertString(0,"No");
	m_comboOpenFlueOrChimney.InsertString(1,"Yes");

	m_comboUnconnectedGasPoint.InsertString(0,"No");
	m_comboUnconnectedGasPoint.InsertString(1,"Yes");

	m_comboEffFrom.InsertString(0,"Manufacturer declaration");

	int nIndex = 0;
	unsigned int i = 0;
	m_comboFuel.ResetContent();
	for(i = 0; i < SAPcostTable_New.size(); i++)
	{
		if ((nIndex=m_comboFuel.FindStringExact(nIndex, SAPcostTable_New[i].fuelType)) != CB_ERR)
		{
			; // Do nothing
		}
		else
		{
			// Fill fuel drop down menu
			m_comboFuel.AddString(SAPcostTable_New[i].fuelType);
		}
	}

	m_comboSystem.InsertString(0,"Pre 1980 - Open front fire with open flue");
	m_comboSystem.InsertString(1,"1980 or later - Open front fire with open flue - proud of and sealed to fire place");
	m_comboSystem.InsertString(2,"Fire or wall heater with balanced flue");
	m_comboSystem.InsertString(3,"Open front fire with back boiler - proud of and sealed to fire place");
	m_comboSystem.InsertString(4,"Closed fornt fire with fan flue");
	m_comboSystem.InsertString(5,"Condensing gas fire");
	m_comboSystem.InsertString(6,"Flush fitting live fuel effect open front fire sealed to fire place - no fan flue");
	m_comboSystem.InsertString(7,"Flush fitting live fuel effect open front fire sealed to fire place - fan flue");
	m_comboSystem.InsertString(8,"Decorative fuel effect fire open to chimney");
	m_comboSystem.InsertString(9,"Flueless fire");
	m_comboSystem.InsertString(10,"Flush fitting live fuel effect open front fire sealed to fireplace with back boiler");
	m_comboSystem.InsertString(11,"Uknown");

	m_comboTestMethod.InsertString(0,"BS EN 613");
	m_comboTestMethod.InsertString(1,"BS EN 13278");
	m_comboTestMethod.InsertString(2,"BS EN 1266");
	m_comboTestMethod.InsertString(3,"BS EN 7977-1");
	m_comboTestMethod.InsertString(4,"BS EN 7977-2");
	m_comboTestMethod.InsertString(5,"Uknown");
}

void CDlg_SecHeating::DisplayValuesForSecHeatingDlg()
{
	str_comboIsSecHtPresent.Format("%s",isThereSecHeating);
	str_comboOpenFlueOrChimney.Format("%s",secHtOpenFlueChimney);
	str_comboUnconnectedGasPoint.Format("%s",secHtUnconnectedGasPoint);
	str_comboEffFrom.Format("%s",secHtEffFrom);
	str_comboFuel.Format("%s",secHtFuel);
	str_editSecHtFraction.Format("%.2f",secHtFraction);

	// Reset combo box for system and add new strings based on fuel type
	m_comboSystem.ResetContent();

	if((secHtFuel=="Mains gas") || (secHtFuel=="Bottled gas"))
	{
		m_comboSystem.InsertString(0,"Pre 1980 - Open front fire with open flue");
		m_comboSystem.InsertString(1,"1980 or later - Open front fire with open flue - proud of and sealed to fire place");
		m_comboSystem.InsertString(2,"Fire or wall heater with balanced flue");
		m_comboSystem.InsertString(3,"Open front fire with back boiler - proud of and sealed to fire place");
		m_comboSystem.InsertString(4,"Closed fornt fire with fan flue");
		m_comboSystem.InsertString(5,"Condensing gas fire");
		m_comboSystem.InsertString(6,"Flush fitting live fuel effect open front fire sealed to fire place - no fan flue");
		m_comboSystem.InsertString(7,"Flush fitting live fuel effect open front fire sealed to fire place - fan flue");
		m_comboSystem.InsertString(8,"Decorative fuel effect fire open to chimney");
		m_comboSystem.InsertString(9,"Flueless fire");
		m_comboSystem.InsertString(10,"Flush fitting live fuel effect open front fire sealed to fireplace with back boiler");
	}
	
	if(secHtFuel=="Electricity")
	{
		m_comboSystem.InsertString(0,"Panel or convector or radiator heaters");
		m_comboSystem.InsertString(1,"Fan heaters");
		m_comboSystem.InsertString(2,"Portable electric heaters");
	}
	if (secHtFuel=="LPG")
	{
		m_comboSystem.InsertString(0,"Pre 1980 - Open front fire with open flue");
		m_comboSystem.InsertString(1,"1980 or later - Open front fire with open flue - proud of and sealed to fire place");
		m_comboSystem.InsertString(2,"Open front fire with back boiler - proud of and sealed to fire place");
		m_comboSystem.InsertString(3,"Flush fitting live fuel effect open front fire sealed to fire place - no fan flue");
		m_comboSystem.InsertString(4,"Flush fitting live fuel effect open front fire sealed to fire place with back boiler");
		m_comboSystem.InsertString(5,"Flush fitting live fuel effect open front fire sealed to fire place - fan flue");
		m_comboSystem.InsertString(6,"Fire or wall heater with balanced flue");
		m_comboSystem.InsertString(7,"Closed front fire with fan flue");
		m_comboSystem.InsertString(8,"Condensing gas fire");
		m_comboSystem.InsertString(9,"Decorative fuel effect fire open to chimney");
		m_comboSystem.InsertString(10,"Fluless fire");
	}
	
	if (secHtFuel == "Oil")
	{
		m_comboSystem.InsertString(0,"Pre 2000 - Room heater");
		m_comboSystem.InsertString(1,"2000 or later - Room heater");
		m_comboSystem.InsertString(2,"Pre 2000 - Room heater with back boiler (no radiators)");
		m_comboSystem.InsertString(3,"2000 or later - Room heater with back boiler (no radiators)");
	}
	
	
	if ((secHtFuel == "House coal") || 
		(secHtFuel == "Smokeless") ||
		(secHtFuel == "Anthracite") ||
		(secHtFuel == "Wood logs") || 
		(secHtFuel == "Wood chips") ||
		(secHtFuel == "Dual fuel (mineral and wood)"))
	{
		m_comboSystem.InsertString(0,"Open fire in grate");
		m_comboSystem.InsertString(1,"Open fire with back boiler (no radiators)");
		m_comboSystem.InsertString(2,"Closed room heater");
		m_comboSystem.InsertString(3,"Closed room heater with boiler (no radiators)");
		m_comboSystem.InsertString(4,"Open fire in grate - HETAS approved");
		m_comboSystem.InsertString(5,"Open fire with back boiler (no radiators) - HETAS approved");
		m_comboSystem.InsertString(6,"Closed room heater - HETAS approved");
		m_comboSystem.InsertString(7,"Closed room heater with boiler (no radiators) - HETAS approved");
	}

	if ((secHtFuel == "Wood pellets in bags") ||(secHtFuel == "Bulk wood pellets"))
	{
		m_comboSystem.InsertString(0,"Open fire in grate");
		m_comboSystem.InsertString(1,"Open fire with back boiler (no radiators)");
		m_comboSystem.InsertString(2,"Closed room heater");
		m_comboSystem.InsertString(3,"Closed room heater with boiler (no radiators)");
		m_comboSystem.InsertString(4,"Stove (pellet fired)");
		m_comboSystem.InsertString(5,"Stove (pellet fired)with boiler (no radiators)");
		m_comboSystem.InsertString(6,"Open fire in grate - HETAS approved");
		m_comboSystem.InsertString(7,"Open fire with back boiler (no radiators) - HETAS approved");
		m_comboSystem.InsertString(8,"Closed room heater - HETAS approved");
		m_comboSystem.InsertString(9,"Closed room heater with boiler (no radiators) - HETAS approved");
	}	

	str_comboSystem.Format("%s",secHtSystem);
	str_editManufactDesc.Format("%s",secHtManufactDesc);
	str_comboTestMethod.Format("%s",secHtTestMethod);
	str_editEff.Format("%.0f",secHtEff);
	str_editSecHtFraction.Format("%.2f",secHtFraction);

	UpdateData(FALSE);
}

void CDlg_SecHeating::ReadInputsFromSecHeatingDlg()
{
	UpdateData(TRUE);
	 
	unsigned int i = 0;

	isThereSecHeating        = str_comboIsSecHtPresent;
	secHtOpenFlueChimney     = str_comboOpenFlueOrChimney;
	secHtUnconnectedGasPoint = str_comboUnconnectedGasPoint;

	secHtEffFrom = str_comboEffFrom;
	secHtFuel    = str_comboFuel;
	secHtSystem  = str_comboSystem;

	secHtManufactDesc = str_editManufactDesc;
	secHtTestMethod   = str_comboTestMethod;
	secHtFraction     = atof(str_editSecHtFraction);

	// if SAP default
	if(secHtEffFrom == "SAP default")
	{
		m_editEff.SetReadOnly(TRUE);

		for(i = 0; i < secHtSysData_New.size(); i++)
		{
			if((secHtFuel == secHtSysData_New[i].fuelType) && (secHtSystem == secHtSysData_New[i].systemType))
			{
				secHtEff = secHtSysData_New[i].effeciency;
				str_editEff.Format("%.0f", secHtEff);
				UpdateData(FALSE);
			}
		}	
	}
	else
	{
		m_editEff.SetReadOnly(FALSE);
	}

	secHtEff          = atof(str_editEff);
}
void CDlg_SecHeating::OnCbnSelchangeComboIssechtpresent()
{
	ReadInputsFromSecHeatingDlg();
}

void CDlg_SecHeating::OnCbnSelchangeComboIsthereopenfluechimney()
{
	ReadInputsFromSecHeatingDlg();
}

void CDlg_SecHeating::OnCbnSelchangeComboIsthereunconnectedgaspoint()
{
	ReadInputsFromSecHeatingDlg();
}

void CDlg_SecHeating::OnCbnSelchangeComboEfffrom()
{
	ReadInputsFromSecHeatingDlg();
}

void CDlg_SecHeating::OnCbnSelchangeComboFuel()
{
	UpdateData(TRUE);

	m_comboSystem.ResetContent();

	if((str_comboFuel=="Mains gas") || (str_comboFuel=="Bottled gas"))
	{
		m_comboSystem.InsertString(0,"Pre 1980 - Open front fire with open flue");
		m_comboSystem.InsertString(1,"1980 or later - Open front fire with open flue - proud of and sealed to fire place");
		m_comboSystem.InsertString(2,"Fire or wall heater with balanced flue");
		m_comboSystem.InsertString(3,"Open front fire with back boiler - proud of and sealed to fire place");
		m_comboSystem.InsertString(4,"Closed fornt fire with fan flue");
		m_comboSystem.InsertString(5,"Condensing gas fire");
		m_comboSystem.InsertString(6,"Flush fitting live fuel effect open front fire sealed to fire place - no fan flue");
		m_comboSystem.InsertString(7,"Flush fitting live fuel effect open front fire sealed to fire place - fan flue");
		m_comboSystem.InsertString(8,"Decorative fuel effect fire open to chimney");
		m_comboSystem.InsertString(9,"Flueless fire");
		m_comboSystem.InsertString(10,"Flush fitting live fuel effect open front fire sealed to fireplace with back boiler");
	}
	
	if(str_comboFuel=="Electricity")
	{
		m_comboSystem.InsertString(0,"Panel or convector or radiator heaters");
		m_comboSystem.InsertString(1,"Fan heaters");
		m_comboSystem.InsertString(2,"Portable electric heaters");
	}
	if (str_comboFuel=="LPG")
	{
		m_comboSystem.InsertString(0,"Pre 1980 - Open front fire with open flue");
		m_comboSystem.InsertString(1,"1980 or later - Open front fire with open flue - proud of and sealed to fire place");
		m_comboSystem.InsertString(2,"Open front fire with back boiler - proud of and sealed to fire place");
		m_comboSystem.InsertString(3,"Closed fornt fire with fan flue");
		m_comboSystem.InsertString(4,"Flush fitting live fuel effect open front fire sealed to fire place - no fan flue");
		m_comboSystem.InsertString(5,"Flush fitting live fuel effect open front fire sealed to fire place with back boiler");
		m_comboSystem.InsertString(6,"Flush fitting live fuel effect open front fire sealed to fire place - fan flue");
		m_comboSystem.InsertString(7,"Fire or wall heater with balanced flue");
		m_comboSystem.InsertString(8,"Closed front fire with fan flue");
		m_comboSystem.InsertString(9,"Condensing gas fire");
		m_comboSystem.InsertString(10,"Decorative fuel effect fire open to chimney");
		m_comboSystem.InsertString(11,"Fluless fire");
	}
	
	if (str_comboFuel == "Oil")
	{
		m_comboSystem.InsertString(0,"Pre 2000 - Room heater");
		m_comboSystem.InsertString(1,"2000 or later - Room heater");
		m_comboSystem.InsertString(2,"Pre 2000 - Room heater with back boiler (no radiators)");
		m_comboSystem.InsertString(3,"2000 or later - Room heater with back boiler (no radiators)");
	}
	
	
	if ((str_comboFuel == "House coal") || 
		(str_comboFuel == "Smokeless") ||
		(str_comboFuel == "Anthracite") ||
		(str_comboFuel == "Wood logs") || 
		(str_comboFuel == "Wood chips") ||
		(str_comboFuel == "Dual fuel (mineral and wood)"))
	{
		m_comboSystem.InsertString(0,"Open fire in grate");
		m_comboSystem.InsertString(1,"Open fire with back boiler (no radiators)");
		m_comboSystem.InsertString(2,"Closed room heater");
		m_comboSystem.InsertString(3,"Closed room heater with boiler (no radiators)");
		m_comboSystem.InsertString(4,"Open fire in grate - HETAS approved");
		m_comboSystem.InsertString(5,"Open fire with back boiler (no radiators) - HETAS approved");
		m_comboSystem.InsertString(6,"Closed room heater - HETAS approved");
		m_comboSystem.InsertString(7,"Closed room heater with boiler (no radiators) - HETAS approved");
	}

	if ((str_comboFuel == "Wood pellets in bags") ||(str_comboFuel == "Bulk wood pellets"))
	{
		m_comboSystem.InsertString(0,"Open fire in grate");
		m_comboSystem.InsertString(1,"Open fire with back boiler (no radiators)");
		m_comboSystem.InsertString(2,"Closed room heater");
		m_comboSystem.InsertString(3,"Closed room heater with boiler (no radiators)");
		m_comboSystem.InsertString(4,"Stove (pellet fired)");
		m_comboSystem.InsertString(5,"Stove (pellet fired)with boiler (no radiators)");
		m_comboSystem.InsertString(6,"Open fire in grate - HETAS approved");
		m_comboSystem.InsertString(7,"Open fire with back boiler (no radiators) - HETAS approved");
		m_comboSystem.InsertString(8,"Closed room heater - HETAS approved");
		m_comboSystem.InsertString(9,"Closed room heater with boiler (no radiators) - HETAS approved");
		m_comboSystem.InsertString(10,"Stove (pellet fired) - HETAS approved");
		m_comboSystem.InsertString(11,"Stove (pellet fired)with boiler (no radiators) - HETAS approved");
	}
	
	// Efficieny is based on Fuel and system
	ReadInputsFromSecHeatingDlg();

	unsigned int i = 0;

	// if SAP default
	if(secHtEffFrom == "SAP default")
	{
		m_editEff.SetReadOnly(TRUE);

		for(i = 0; i < secHtSysData_New.size(); i++)
		{
			if((secHtFuel == secHtSysData_New[i].fuelType) && (secHtSystem == secHtSysData_New[i].systemType))
			{
				secHtEff = secHtSysData_New[i].effeciency;
				str_editEff.Format("%.0f", secHtEff);
				UpdateData(FALSE);
			}
		}	
	}
	else
	{
		m_editEff.SetReadOnly(FALSE);
	}
	secHtEff          = atof(str_editEff);
	secHtFraction = atof(str_editSecHtFraction);
}

void CDlg_SecHeating::OnCbnSelchangeCombosystem()
{
	ReadInputsFromSecHeatingDlg();	
}

void CDlg_SecHeating::OnEnChangeEditManufactdesc()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-*&%!'@#_:;.0123456789 ");
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editManufactDesc, lpszValidChars) != 0) 
	{
		str_editManufactDesc = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromSecHeatingDlg();

	unsigned int i = 0;

	// if SAP default
	if(secHtEffFrom == "SAP default")
	{
		m_editEff.SetReadOnly(TRUE);

		for(i = 0; i < secHtSysData_New.size(); i++)
		{
			if((secHtFuel == secHtSysData_New[i].fuelType) && (secHtSystem == secHtSysData_New[i].systemType))
			{
				secHtEff = secHtSysData_New[i].effeciency;
				str_editEff.Format("%.0f", secHtEff);
				UpdateData(FALSE);
			}
		}	
	}
	else
	{
		m_editEff.SetReadOnly(FALSE);
	}
	secHtEff          = atof(str_editEff);
}

void CDlg_SecHeating::OnCbnSelchangeCombotestmethod()
{
	ReadInputsFromSecHeatingDlg();
}

void CDlg_SecHeating::OnEnChangeEditeff()
{
	int n = 0;
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T(".0123456789 ");
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editEff, lpszValidChars) != 0) 
	{
		//TextBox1.Text = TextBox1.Text.Substring(0, TextBox1.Text.Length - 1)
		
		str_editEff = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromSecHeatingDlg();
					
	// Check limit
	isCheckRange_secHtEff= true;;
}

void CDlg_SecHeating::OnEnChangeEdit1()
{
	ReadInputsFromSecHeatingDlg();
					
	// Check limit
	isCheckRange_secHtFraction= true;

	// To make sure the sum of secHtFraction and mainHtFractionSupplied is 1
	secHtFraction = 1 - mainHtFractionSupplied;
}

BOOL CDlg_SecHeating::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(pMsg->message==WM_KEYDOWN)
	{
		if(pMsg->wParam==VK_RETURN || pMsg->wParam==VK_ESCAPE)
			pMsg->wParam=NULL ;
	} 

	return CDialog::PreTranslateMessage(pMsg);
}