// Dlg_Floors.cpp : implementation file
//

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


// CDlg_Floors dialog

IMPLEMENT_DYNAMIC(CDlg_Floors, CDialog)
CDlg_Floors::CDlg_Floors(CWnd* pParent /*=NULL*/)
	: CDialog(CDlg_Floors::IDD, pParent)
	, str_editFloor1Name(_T(""))
	, str_editFloor2Name(_T(""))
	, str_editFloor3Name(_T(""))
	, str_editFloor4Name(_T(""))
	, str_editFloor5Name(_T(""))
	, str_editFloor6Name(_T(""))
	, str_editFloor7Name(_T(""))
	, str_editFloor8Name(_T(""))
	, str_editFloor9Name(_T(""))
	, str_editFloor10Name(_T(""))
	, str_comboFloor1Type(_T(""))
	, str_comboFloor2Type(_T(""))
	, str_comboFloor3Type(_T(""))
	, str_comboFloor4Type(_T(""))
	, str_comboFloor5Type(_T(""))
	, str_comboFloor6Type(_T(""))
	, str_comboFloor7Type(_T(""))
	, str_comboFloor8Type(_T(""))
	, str_comboFloor9Type(_T(""))
	, str_comboFloor10Type(_T(""))
	, str_comboFloor1Construction(_T(""))
	, str_comboFloor2Construction(_T(""))
	, str_comboFloor3Construction(_T(""))
	, str_comboFloor4Construction(_T(""))
	, str_comboFloor5Construction(_T(""))
	, str_comboFloor6Construction(_T(""))
	, str_comboFloor7Construction(_T(""))
	, str_comboFloor8Construction(_T(""))
	, str_comboFloor9Construction(_T(""))
	, str_comboFloor10Construction(_T(""))
	, str_editFloor1Area(_T(""))
	, str_editFloor2Area(_T(""))
	, str_editFloor3Area(_T(""))
	, str_editFloor4Area(_T(""))
	, str_editFloor5Area(_T(""))
	, str_editFloor6Area(_T(""))
	, str_editFloor7Area(_T(""))
	, str_editFloor8Area(_T(""))
	, str_editFloor9Area(_T(""))
	, str_editFloor10Area(_T(""))
	, str_editFloor1Uvalue(_T(""))
	, str_editFloor2Uvalue(_T(""))
	, str_editFloor3Uvalue(_T(""))
	, str_editFloor4Uvalue(_T(""))
	, str_editFloor5Uvalue(_T(""))
	, str_editFloor6Uvalue(_T(""))
	, str_editFloor7Uvalue(_T(""))
	, str_editFloor8Uvalue(_T(""))
	, str_editFloor9Uvalue(_T(""))
	, str_editFloor10Uvalue(_T(""))
{
}

CDlg_Floors::~CDlg_Floors()
{
}

void CDlg_Floors::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_CHECK1, m_btnFloor1);
	DDX_Control(pDX, IDC_CHECK3, m_btnFloor2);
	DDX_Control(pDX, IDC_CHECK5, m_btnFloor3);
	DDX_Control(pDX, IDC_CHECK13, m_btnFloor4);
	DDX_Control(pDX, IDC_CHECK8, m_btnFloor5);
	DDX_Control(pDX, IDC_CHECK9, m_btnFloor6);
	DDX_Control(pDX, IDC_CHECK15, m_btnFloor7);
	DDX_Control(pDX, IDC_CHECK16, m_btnFloor8);
	DDX_Control(pDX, IDC_CHECK17, m_btnFloor9);
	DDX_Control(pDX, IDC_CHECK19, m_btnFloor10);
	DDX_Control(pDX, IDC_EDIT12, m_editFloor1Name);
	DDX_Control(pDX, IDC_EDIT15, m_editFloor2Name);
	DDX_Control(pDX, IDC_EDIT18, m_editFloor3Name);
	DDX_Control(pDX, IDC_EDIT21, m_editFloor4Name);
	DDX_Control(pDX, IDC_EDIT25, m_editFloor5Name);
	DDX_Control(pDX, IDC_EDIT28, m_editFloor6Name);
	DDX_Control(pDX, IDC_EDIT31, m_editFloor7Name);
	DDX_Control(pDX, IDC_EDIT34, m_editFloor8Name);
	DDX_Control(pDX, IDC_EDIT37, m_editFloor9Name);
	DDX_Control(pDX, IDC_EDIT40, m_editFloor10Name);
	DDX_Control(pDX, IDC_COMBO1, m_comboFloor1Type);
	DDX_Control(pDX, IDC_COMBO4, m_comboFloor2Type);
	DDX_Control(pDX, IDC_COMBO12, m_comboFloor3Type);
	DDX_Control(pDX, IDC_COMBO14, m_comboFloor4Type);
	DDX_Control(pDX, IDC_COMBO16, m_comboFloor5Type);
	DDX_Control(pDX, IDC_COMBO18, m_comboFloor6Type);
	DDX_Control(pDX, IDC_COMBO20, m_comboFloor7Type);
	DDX_Control(pDX, IDC_COMBO22, m_comboFloor8Type);
	DDX_Control(pDX, IDC_COMBO24, m_comboFloor9Type);
	DDX_Control(pDX, IDC_COMBO26, m_comboFloor10Type);
	DDX_Control(pDX, IDC_COMBO3, m_comboFloor1Construction);
	DDX_Control(pDX, IDC_COMBO11, m_comboFloor2Construction);
	DDX_Control(pDX, IDC_COMBO13, m_comboFloor3Construction);
	DDX_Control(pDX, IDC_COMBO15, m_comboFloor4Construction);
	DDX_Control(pDX, IDC_COMBO17, m_comboFloor5Construction);
	DDX_Control(pDX, IDC_COMBO19, m_comboFloor6Construction);
	DDX_Control(pDX, IDC_COMBO21, m_comboFloor7Construction);
	DDX_Control(pDX, IDC_COMBO23, m_comboFloor8Construction);
	DDX_Control(pDX, IDC_COMBO25, m_comboFloor9Construction);
	DDX_Control(pDX, IDC_COMBO27, m_comboFloor10Construction);
	DDX_Control(pDX, IDC_CHECK2, m_btnFloor1Sealed);
	DDX_Control(pDX, IDC_CHECK4, m_btnFloor2Sealed);
	DDX_Control(pDX, IDC_CHECK6, m_btnFloor3Sealed);
	DDX_Control(pDX, IDC_CHECK7, m_btnFloor4Sealed);
	DDX_Control(pDX, IDC_CHECK14, m_btnFloor5Sealed);
	DDX_Control(pDX, IDC_CHECK10, m_btnFloor6Sealed);
	DDX_Control(pDX, IDC_CHECK11, m_btnFloor7Sealed);
	DDX_Control(pDX, IDC_CHECK12, m_btnFloor8Sealed);
	DDX_Control(pDX, IDC_CHECK18, m_btnFloor9Sealed);
	DDX_Control(pDX, IDC_CHECK20, m_btnFloor10Sealed);
	DDX_Control(pDX, IDC_EDIT13, m_editFloor1Area);
	DDX_Control(pDX, IDC_EDIT16, m_editFloor2Area);
	DDX_Control(pDX, IDC_EDIT19, m_editFloor3Area);
	DDX_Control(pDX, IDC_EDIT22, m_editFloor4Area);
	DDX_Control(pDX, IDC_EDIT26, m_editFloor5Area);
	DDX_Control(pDX, IDC_EDIT29, m_editFloor6Area);
	DDX_Control(pDX, IDC_EDIT32, m_editFloor7Area);
	DDX_Control(pDX, IDC_EDIT35, m_editFloor8Area);
	DDX_Control(pDX, IDC_EDIT38, m_editFloor9Area);
	DDX_Control(pDX, IDC_EDIT41, m_editFloor10Area);
	DDX_Control(pDX, IDC_EDIT14, m_editFloor1Uvalue);
	DDX_Control(pDX, IDC_EDIT17, m_editFloor2Uvalue);
	DDX_Control(pDX, IDC_EDIT20, m_editFloor3Uvalue);
	DDX_Control(pDX, IDC_EDIT23, m_editFloor4Uvalue);
	DDX_Control(pDX, IDC_EDIT27, m_editFloor5Uvalue);
	DDX_Control(pDX, IDC_EDIT30, m_editFloor6Uvalue);
	DDX_Control(pDX, IDC_EDIT33, m_editFloor7Uvalue);
	DDX_Control(pDX, IDC_EDIT36, m_editFloor8Uvalue);
	DDX_Control(pDX, IDC_EDIT39, m_editFloor9Uvalue);
	DDX_Control(pDX, IDC_EDIT42, m_editFloor10Uvalue);
	DDX_Text(pDX, IDC_EDIT12, str_editFloor1Name);
	DDX_Text(pDX, IDC_EDIT15, str_editFloor2Name);
	DDX_Text(pDX, IDC_EDIT18, str_editFloor3Name);
	DDX_Text(pDX, IDC_EDIT21, str_editFloor4Name);
	DDX_Text(pDX, IDC_EDIT25, str_editFloor5Name);
	DDX_Text(pDX, IDC_EDIT28, str_editFloor6Name);
	DDX_Text(pDX, IDC_EDIT31, str_editFloor7Name);
	DDX_Text(pDX, IDC_EDIT34, str_editFloor8Name);
	DDX_Text(pDX, IDC_EDIT37, str_editFloor9Name);
	DDX_Text(pDX, IDC_EDIT40, str_editFloor10Name);
	DDX_CBString(pDX, IDC_COMBO1, str_comboFloor1Type);
	DDX_CBString(pDX, IDC_COMBO4, str_comboFloor2Type);
	DDX_CBString(pDX, IDC_COMBO12, str_comboFloor3Type);
	DDX_CBString(pDX, IDC_COMBO14, str_comboFloor4Type);
	DDX_CBString(pDX, IDC_COMBO16, str_comboFloor5Type);
	DDX_CBString(pDX, IDC_COMBO18, str_comboFloor6Type);
	DDX_CBString(pDX, IDC_COMBO20, str_comboFloor7Type);
	DDX_CBString(pDX, IDC_COMBO22, str_comboFloor8Type);
	DDX_CBString(pDX, IDC_COMBO24, str_comboFloor9Type);
	DDX_CBString(pDX, IDC_COMBO26, str_comboFloor10Type);
	DDX_CBString(pDX, IDC_COMBO3, str_comboFloor1Construction);
	DDX_CBString(pDX, IDC_COMBO11, str_comboFloor2Construction);
	DDX_CBString(pDX, IDC_COMBO13, str_comboFloor3Construction);
	DDX_CBString(pDX, IDC_COMBO15, str_comboFloor4Construction);
	DDX_CBString(pDX, IDC_COMBO17, str_comboFloor5Construction);
	DDX_CBString(pDX, IDC_COMBO19, str_comboFloor6Construction);
	DDX_CBString(pDX, IDC_COMBO21, str_comboFloor7Construction);
	DDX_CBString(pDX, IDC_COMBO23, str_comboFloor8Construction);
	DDX_CBString(pDX, IDC_COMBO25, str_comboFloor9Construction);
	DDX_CBString(pDX, IDC_COMBO27, str_comboFloor10Construction);
	DDX_Text(pDX, IDC_EDIT13, str_editFloor1Area);
	DDX_Text(pDX, IDC_EDIT16, str_editFloor2Area);
	DDX_Text(pDX, IDC_EDIT19, str_editFloor3Area);
	DDX_Text(pDX, IDC_EDIT22, str_editFloor4Area);
	DDX_Text(pDX, IDC_EDIT26, str_editFloor5Area);
	DDX_Text(pDX, IDC_EDIT29, str_editFloor6Area);
	DDX_Text(pDX, IDC_EDIT32, str_editFloor7Area);
	DDX_Text(pDX, IDC_EDIT35, str_editFloor8Area);
	DDX_Text(pDX, IDC_EDIT38, str_editFloor9Area);
	DDX_Text(pDX, IDC_EDIT41, str_editFloor10Area);
	DDX_Text(pDX, IDC_EDIT14, str_editFloor1Uvalue);
	DDX_Text(pDX, IDC_EDIT17, str_editFloor2Uvalue);
	DDX_Text(pDX, IDC_EDIT20, str_editFloor3Uvalue);
	DDX_Text(pDX, IDC_EDIT23, str_editFloor4Uvalue);
	DDX_Text(pDX, IDC_EDIT27, str_editFloor5Uvalue);
	DDX_Text(pDX, IDC_EDIT30, str_editFloor6Uvalue);
	DDX_Text(pDX, IDC_EDIT33, str_editFloor7Uvalue);
	DDX_Text(pDX, IDC_EDIT36, str_editFloor8Uvalue);
	DDX_Text(pDX, IDC_EDIT39, str_editFloor9Uvalue);
	DDX_Text(pDX, IDC_EDIT42, str_editFloor10Uvalue);
	DDX_Control(pDX, IDC_STATIC_1, m_labelHL);
}


BEGIN_MESSAGE_MAP(CDlg_Floors, CDialog)
	ON_CBN_SELCHANGE(IDC_COMBO1, OnCbnSelchangeCombo1)
	ON_BN_CLICKED(IDC_CHECK1, OnBnClickedCheck1)
	ON_BN_CLICKED(IDC_CHECK3, OnBnClickedCheck3)
	ON_BN_CLICKED(IDC_CHECK5, OnBnClickedCheck5)
	ON_BN_CLICKED(IDC_CHECK13, OnBnClickedCheck13)
	ON_BN_CLICKED(IDC_CHECK8, OnBnClickedCheck8)
	ON_BN_CLICKED(IDC_CHECK9, OnBnClickedCheck9)
	ON_BN_CLICKED(IDC_CHECK15, OnBnClickedCheck15)
	ON_BN_CLICKED(IDC_CHECK16, OnBnClickedCheck16)
	ON_BN_CLICKED(IDC_CHECK17, OnBnClickedCheck17)
	ON_BN_CLICKED(IDC_CHECK19, OnBnClickedCheck19)
	ON_EN_CHANGE(IDC_EDIT12, OnEnChangeEdit12)
	ON_EN_CHANGE(IDC_EDIT15, OnEnChangeEdit15)
	ON_EN_CHANGE(IDC_EDIT18, OnEnChangeEdit18)
	ON_EN_CHANGE(IDC_EDIT21, OnEnChangeEdit21)
	ON_EN_CHANGE(IDC_EDIT25, OnEnChangeEdit25)
	ON_EN_CHANGE(IDC_EDIT28, OnEnChangeEdit28)
	ON_EN_CHANGE(IDC_EDIT31, OnEnChangeEdit31)
	ON_EN_CHANGE(IDC_EDIT34, OnEnChangeEdit34)
	ON_EN_CHANGE(IDC_EDIT37, OnEnChangeEdit37)
	ON_EN_CHANGE(IDC_EDIT40, OnEnChangeEdit40)
	ON_CBN_SELCHANGE(IDC_COMBO4, OnCbnSelchangeCombo4)
	ON_CBN_SELCHANGE(IDC_COMBO12, OnCbnSelchangeCombo12)
	ON_CBN_SELCHANGE(IDC_COMBO14, OnCbnSelchangeCombo14)
	ON_CBN_SELCHANGE(IDC_COMBO16, OnCbnSelchangeCombo16)
	ON_CBN_SELCHANGE(IDC_COMBO18, OnCbnSelchangeCombo18)
	ON_CBN_SELCHANGE(IDC_COMBO20, OnCbnSelchangeCombo20)
	ON_CBN_SELCHANGE(IDC_COMBO22, OnCbnSelchangeCombo22)
	ON_CBN_SELCHANGE(IDC_COMBO24, OnCbnSelchangeCombo24)
	ON_CBN_SELCHANGE(IDC_COMBO26, OnCbnSelchangeCombo26)
	ON_CBN_SELCHANGE(IDC_COMBO3, OnCbnSelchangeCombo3)
	ON_CBN_SELCHANGE(IDC_COMBO11, OnCbnSelchangeCombo11)
	ON_CBN_SELCHANGE(IDC_COMBO13, OnCbnSelchangeCombo13)
	ON_CBN_SELCHANGE(IDC_COMBO15, OnCbnSelchangeCombo15)
	ON_CBN_SELCHANGE(IDC_COMBO17, OnCbnSelchangeCombo17)
	ON_CBN_SELCHANGE(IDC_COMBO19, OnCbnSelchangeCombo19)
	ON_CBN_SELCHANGE(IDC_COMBO21, OnCbnSelchangeCombo21)
	ON_CBN_SELCHANGE(IDC_COMBO23, OnCbnSelchangeCombo23)
	ON_CBN_SELCHANGE(IDC_COMBO25, OnCbnSelchangeCombo25)
	ON_CBN_SELCHANGE(IDC_COMBO27, OnCbnSelchangeCombo27)
	ON_BN_CLICKED(IDC_CHECK2, OnBnClickedCheck2)
	ON_BN_CLICKED(IDC_CHECK4, OnBnClickedCheck4)
	ON_BN_CLICKED(IDC_CHECK6, OnBnClickedCheck6)
	ON_BN_CLICKED(IDC_CHECK7, OnBnClickedCheck7)
	ON_BN_CLICKED(IDC_CHECK14, OnBnClickedCheck14)
	ON_BN_CLICKED(IDC_CHECK10, OnBnClickedCheck10)
	ON_BN_CLICKED(IDC_CHECK11, OnBnClickedCheck11)
	ON_BN_CLICKED(IDC_CHECK12, OnBnClickedCheck12)
	ON_BN_CLICKED(IDC_CHECK18, OnBnClickedCheck18)
	ON_BN_CLICKED(IDC_CHECK20, OnBnClickedCheck20)
	ON_EN_CHANGE(IDC_EDIT13, OnEnChangeEdit13)
	ON_EN_CHANGE(IDC_EDIT16, OnEnChangeEdit16)
	ON_EN_CHANGE(IDC_EDIT19, OnEnChangeEdit19)
	ON_EN_CHANGE(IDC_EDIT22, OnEnChangeEdit22)
	ON_EN_CHANGE(IDC_EDIT26, OnEnChangeEdit26)
	ON_EN_CHANGE(IDC_EDIT29, OnEnChangeEdit29)
	ON_EN_CHANGE(IDC_EDIT32, OnEnChangeEdit32)
	ON_EN_CHANGE(IDC_EDIT35, OnEnChangeEdit35)
	ON_EN_CHANGE(IDC_EDIT38, OnEnChangeEdit38)
	ON_EN_CHANGE(IDC_EDIT41, OnEnChangeEdit41)
	ON_EN_CHANGE(IDC_EDIT14, OnEnChangeEdit14)
	ON_EN_CHANGE(IDC_EDIT17, OnEnChangeEdit17)
	ON_EN_CHANGE(IDC_EDIT20, OnEnChangeEdit20)
	ON_EN_CHANGE(IDC_EDIT23, OnEnChangeEdit23)
	ON_EN_CHANGE(IDC_EDIT27, OnEnChangeEdit27)
	ON_EN_CHANGE(IDC_EDIT30, OnEnChangeEdit30)
	ON_EN_CHANGE(IDC_EDIT33, OnEnChangeEdit33)
	ON_EN_CHANGE(IDC_EDIT36, OnEnChangeEdit36)
	ON_EN_CHANGE(IDC_EDIT39, OnEnChangeEdit39)
	ON_EN_CHANGE(IDC_EDIT42, OnEnChangeEdit42)
END_MESSAGE_MAP()


// CDlg_Floors message handlers




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

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

	//---------------------------------------------------
	// LABELS
	//---------------------------------------------------
	m_labelHL.SetFont(m_Font1); 
	m_labelHL.SetTextColor(BLUE); 

	AddStringsToFloorsDlg();

	if(file_new_selected ==true)
	{
		//-------------------------
		// FLOOR NAME
		//-------------------------
		floor1Name = " "; 
		floor2Name = " "; 
		floor3Name = " "; 
		floor4Name = " "; 
		floor5Name = " "; 
		floor6Name = " "; 
		floor7Name = " "; 
		floor8Name = " "; 
		floor9Name = " "; 
		floor10Name = " "; 

		//-------------------------
		// FLOOR TYPE
		//-------------------------
		floor1Type = " "; 
		floor2Type = " "; 
		floor3Type = " "; 
		floor4Type = " "; 
		floor5Type = " "; 
		floor6Type = " "; 
		floor7Type = " "; 
		floor8Type = " "; 
		floor9Type = " "; 
		floor10Type = " "; 

		//-------------------------
		// FLOOR CONSTRUCTION
		//-------------------------
		floor1Construction = " "; 
		floor2Construction = " "; 
		floor3Construction = " "; 
		floor4Construction = " "; 
		floor5Construction = " "; 
		floor6Construction = " "; 
		floor7Construction = " "; 
		floor8Construction = " "; 
		floor9Construction = " "; 
		floor10Construction = " "; 

		//-------------------------
		// IS FLOOR SEALED
		//-------------------------
		// if not sealed
		m_btnFloor1Sealed.SetCheck(0);	
		m_btnFloor2Sealed.SetCheck(0);	
		m_btnFloor3Sealed.SetCheck(0);	
		m_btnFloor4Sealed.SetCheck(0);	
		m_btnFloor5Sealed.SetCheck(0);	
		m_btnFloor6Sealed.SetCheck(0);
		m_btnFloor7Sealed.SetCheck(0);
		m_btnFloor8Sealed.SetCheck(0);
		m_btnFloor9Sealed.SetCheck(0);
		m_btnFloor10Sealed.SetCheck(0);
		isfloor1Sealed = "no";
		isfloor2Sealed = "no";
		isfloor3Sealed = "no";
		isfloor4Sealed = "no";
		isfloor5Sealed = "no";
		isfloor6Sealed = "no";
		isfloor7Sealed = "no";
		isfloor8Sealed = "no";
		isfloor9Sealed = "no";
		isfloor10Sealed = "no";
		//-------------------------
		// FLOORS AREA
		//-------------------------
		floor1Area = 0;
		floor2Area = 0;
		floor3Area = 0;
		floor4Area = 0;
		floor5Area = 0;
		floor6Area = 0;
		floor7Area = 0;
		floor8Area = 0;
		floor9Area = 0;
		floor10Area = 0;

		floor1Uvalue = 0;
		floor2Uvalue = 0;
		floor3Uvalue = 0;
		floor4Uvalue = 0;
		floor5Uvalue = 0;
		floor6Uvalue = 0;
		floor7Uvalue = 0;
		floor8Uvalue = 0;
		floor9Uvalue = 0;
		floor10Uvalue = 0;
	}

	CheckFloorNameStrings();
	ReadPreviousInputsFromFloorsDlg();	

	return TRUE;
}

void CDlg_Floors::AddStringsToFloorsDlg()
{
	m_comboFloor1Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor1Type.InsertString(1,"Floor of heated basement");
	m_comboFloor1Type.InsertString(2,"Ground");
	m_comboFloor1Type.InsertString(3,"Upper");

	m_comboFloor2Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor2Type.InsertString(1,"Floor of heated basement");
	m_comboFloor2Type.InsertString(2,"Ground");
	m_comboFloor2Type.InsertString(3,"Upper");

	m_comboFloor3Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor3Type.InsertString(1,"Floor of heated basement");
	m_comboFloor3Type.InsertString(2,"Ground");
	m_comboFloor3Type.InsertString(3,"Upper");

	m_comboFloor4Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor4Type.InsertString(1,"Floor of heated basement");
	m_comboFloor4Type.InsertString(2,"Ground");
	m_comboFloor4Type.InsertString(3,"Upper");

	m_comboFloor5Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor5Type.InsertString(1,"Floor of heated basement");
	m_comboFloor5Type.InsertString(2,"Ground");
	m_comboFloor5Type.InsertString(3,"Upper");

	m_comboFloor6Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor6Type.InsertString(1,"Floor of heated basement");
	m_comboFloor6Type.InsertString(2,"Ground");
	m_comboFloor6Type.InsertString(3,"Upper");

	m_comboFloor7Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor7Type.InsertString(1,"Floor of heated basement");
	m_comboFloor7Type.InsertString(2,"Ground");
	m_comboFloor7Type.InsertString(3,"Upper");

	m_comboFloor8Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor8Type.InsertString(1,"Floor of heated basement");
	m_comboFloor8Type.InsertString(2,"Ground");
	m_comboFloor8Type.InsertString(3,"Upper");

	m_comboFloor9Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor9Type.InsertString(1,"Floor of heated basement");
	m_comboFloor9Type.InsertString(2,"Ground");
	m_comboFloor9Type.InsertString(3,"Upper");

	m_comboFloor10Type.InsertString(0,"Floor above unheated basement");
	m_comboFloor10Type.InsertString(1,"Floor of heated basement");
	m_comboFloor10Type.InsertString(2,"Ground");
	m_comboFloor10Type.InsertString(3,"Upper");
}

void CDlg_Floors::ReadPreviousInputsFromFloorsDlg()
{	
	//-------------------------
	// FLOOR NAME
	//-------------------------
	str_editFloor1Name.Format("%s",floor1Name);
	str_editFloor2Name.Format("%s",floor2Name);
	str_editFloor3Name.Format("%s",floor3Name);
	str_editFloor4Name.Format("%s",floor4Name);
	str_editFloor5Name.Format("%s",floor5Name);
	str_editFloor6Name.Format("%s",floor6Name);
	str_editFloor7Name.Format("%s",floor7Name);
	str_editFloor8Name.Format("%s",floor8Name);
	str_editFloor9Name.Format("%s",floor9Name);
	str_editFloor10Name.Format("%s",floor10Name);

	//-------------------------
	// FLOOR TYPE
	//-------------------------
	str_comboFloor1Type.Format("%s",floor1Type);
	str_comboFloor2Type.Format("%s",floor2Type);
	str_comboFloor3Type.Format("%s",floor3Type);
	str_comboFloor4Type.Format("%s",floor4Type);
	str_comboFloor5Type.Format("%s",floor5Type);
	str_comboFloor6Type.Format("%s",floor6Type);
	str_comboFloor7Type.Format("%s",floor7Type);
	str_comboFloor8Type.Format("%s",floor8Type);
	str_comboFloor9Type.Format("%s",floor9Type);
	str_comboFloor10Type.Format("%s",floor10Type);

	//-------------------------
	// FLOOR CONSTRUCTION
	//-------------------------
	// Depending on floor type, add strings to floor construction
	// combo box and then select the appropriate string
	SelectStringsForFloorConstruction();
	
	str_comboFloor1Construction.Format("%s",floor1Construction);
	str_comboFloor2Construction.Format("%s",floor2Construction);
	str_comboFloor3Construction.Format("%s",floor3Construction);
	str_comboFloor4Construction.Format("%s",floor4Construction);
	str_comboFloor5Construction.Format("%s",floor5Construction);
	str_comboFloor6Construction.Format("%s",floor6Construction);
	str_comboFloor7Construction.Format("%s",floor7Construction);
	str_comboFloor8Construction.Format("%s",floor8Construction);
	str_comboFloor9Construction.Format("%s",floor9Construction);
	str_comboFloor10Construction.Format("%s",floor10Construction);

	//-------------------------
	// IS FLOOR SEALED
	//-------------------------
	// if sealed	
	if(isfloor1Sealed == "yes")
	{
		m_btnFloor1Sealed.SetCheck(1);
	}
	if(isfloor2Sealed == "yes")
	{
		m_btnFloor2Sealed.SetCheck(1);
	}
	if(isfloor3Sealed == "yes")
	{
		m_btnFloor3Sealed.SetCheck(1);
	}
	if(isfloor4Sealed == "yes")
	{
		m_btnFloor4Sealed.SetCheck(1);
	}
	if(isfloor5Sealed == "yes")
	{
		m_btnFloor5Sealed.SetCheck(1);
	}
	if(isfloor6Sealed == "yes")
	{
		m_btnFloor6Sealed.SetCheck(1);
	}
	if(isfloor7Sealed == "yes")
	{
		m_btnFloor7Sealed.SetCheck(1);
	}
	if(isfloor8Sealed == "yes")
	{
		m_btnFloor8Sealed.SetCheck(1);
	}
	if(isfloor9Sealed == "yes")
	{
		m_btnFloor9Sealed.SetCheck(1);
	}
	if(isfloor10Sealed == "yes")
	{
		m_btnFloor10Sealed.SetCheck(1);
	}

	// if not sealed
	if(isfloor1Sealed == "no")
	{
		m_btnFloor1Sealed.SetCheck(0);
	}
	if(isfloor2Sealed == "no")
	{
		m_btnFloor2Sealed.SetCheck(0);
	}
	if(isfloor3Sealed == "no")
	{
		m_btnFloor3Sealed.SetCheck(0);
	}
	if(isfloor4Sealed == "no")
	{
		m_btnFloor4Sealed.SetCheck(0);
	}
	if(isfloor5Sealed == "no")
	{
		m_btnFloor5Sealed.SetCheck(0);
	}
	if(isfloor6Sealed == "no")
	{
		m_btnFloor6Sealed.SetCheck(0);
	}
	if(isfloor7Sealed == "no")
	{
		m_btnFloor7Sealed.SetCheck(0);
	}
	if(isfloor8Sealed == "no")
	{
		m_btnFloor8Sealed.SetCheck(0);
	}
	if(isfloor9Sealed == "no")
	{
		m_btnFloor9Sealed.SetCheck(0);
	}
	if(isfloor10Sealed == "no")
	{
		m_btnFloor10Sealed.SetCheck(0);
	}


	//-------------------------
	// FLOORS AREA
	//-------------------------
	str_editFloor1Area.Format("%.1f",floor1Area);
	str_editFloor2Area.Format("%.1f",floor2Area);
	str_editFloor3Area.Format("%.1f",floor3Area);
	str_editFloor4Area.Format("%.1f",floor4Area);
	str_editFloor5Area.Format("%.1f",floor5Area);
	str_editFloor6Area.Format("%.1f",floor6Area);
	str_editFloor7Area.Format("%.1f",floor7Area);
	str_editFloor8Area.Format("%.1f",floor8Area);
	str_editFloor9Area.Format("%.1f",floor9Area);
	str_editFloor10Area.Format("%.1f",floor10Area);

	
	//-------------------------
	// FLOORS U-VALUES
	//-------------------------
	str_editFloor1Uvalue.Format("%.1f",floor1Uvalue);
	str_editFloor2Uvalue.Format("%.1f",floor2Uvalue);
	str_editFloor3Uvalue.Format("%.1f",floor3Uvalue);
	str_editFloor4Uvalue.Format("%.1f",floor4Uvalue);
	str_editFloor5Uvalue.Format("%.1f",floor5Uvalue);
	str_editFloor6Uvalue.Format("%.1f",floor6Uvalue);
	str_editFloor7Uvalue.Format("%.1f",floor7Uvalue);
	str_editFloor8Uvalue.Format("%.1f",floor8Uvalue);
	str_editFloor9Uvalue.Format("%.1f",floor9Uvalue);
	str_editFloor10Uvalue.Format("%.1f",floor10Uvalue);

	CheckFloorNameStrings();

	UpdateData(FALSE);
}

void CDlg_Floors::ReadInputsFromFloorsDlg()
{
	UpdateData(TRUE);


	//-------------------------
	// FLOOR NAME
	//-------------------------
	floor1Name = str_editFloor1Name;
	floor2Name = str_editFloor2Name;
	floor3Name = str_editFloor3Name;
	floor4Name = str_editFloor4Name;
	floor5Name = str_editFloor5Name;
	floor6Name = str_editFloor6Name;
	floor7Name = str_editFloor7Name;
	floor8Name = str_editFloor8Name;
	floor9Name = str_editFloor9Name;
	floor10Name= str_editFloor10Name;

	//-------------------------
	// FLOOR TYPE
	//-------------------------
	floor1Type = str_comboFloor1Type;
	floor2Type = str_comboFloor2Type;
	floor3Type = str_comboFloor3Type;
	floor4Type = str_comboFloor4Type;
	floor5Type = str_comboFloor5Type;
	floor6Type = str_comboFloor6Type;
	floor7Type = str_comboFloor7Type;
	floor8Type = str_comboFloor8Type;
	floor9Type = str_comboFloor9Type;
	floor10Type = str_comboFloor10Type;

	//-------------------------
	// FLOOR CONSTRUCTION
	//-------------------------
	floor1Construction = str_comboFloor1Construction;
	floor2Construction = str_comboFloor2Construction;
	floor3Construction = str_comboFloor3Construction;
	floor4Construction = str_comboFloor4Construction;
	floor5Construction = str_comboFloor5Construction;
	floor6Construction = str_comboFloor6Construction;
	floor7Construction = str_comboFloor7Construction;
	floor8Construction = str_comboFloor8Construction;
	floor9Construction = str_comboFloor9Construction;
	floor10Construction = str_comboFloor10Construction;

	//-------------------------
	// IS FLOOR SEALED
	//-------------------------
	// if sealed
	if(m_btnFloor1Sealed.GetCheck() == 1)
	{
		isfloor1Sealed = "yes";
	}
	if(m_btnFloor2Sealed.GetCheck() == 1)
	{
		isfloor2Sealed = "yes";
	}
	if(m_btnFloor3Sealed.GetCheck() == 1)
	{
		isfloor3Sealed = "yes";
	}
	if(m_btnFloor4Sealed.GetCheck() == 1)
	{
		isfloor4Sealed = "yes";
	}
	if(m_btnFloor5Sealed.GetCheck() == 1)
	{
		isfloor5Sealed = "yes";
	}
	if(m_btnFloor6Sealed.GetCheck() == 1)
	{
		isfloor6Sealed = "yes";
	}
	if(m_btnFloor7Sealed.GetCheck() == 1)
	{
		isfloor7Sealed = "yes";
	}
	if(m_btnFloor8Sealed.GetCheck() == 1)
	{
		isfloor8Sealed = "yes";
	}
	if(m_btnFloor9Sealed.GetCheck() == 1)
	{
		isfloor9Sealed = "yes";
	}
	if(m_btnFloor10Sealed.GetCheck() == 1)
	{
		isfloor10Sealed = "yes";
	}

	// if not sealed
	if(m_btnFloor1Sealed.GetCheck() == 0)
	{
		isfloor1Sealed = "no";
	}
	if(m_btnFloor2Sealed.GetCheck() == 0)
	{
		isfloor2Sealed = "no";
	}
	if(m_btnFloor3Sealed.GetCheck() == 0)
	{
		isfloor3Sealed = "no";
	}
	if(m_btnFloor4Sealed.GetCheck() == 0)
	{
		isfloor4Sealed = "no";
	}
	if(m_btnFloor5Sealed.GetCheck() == 0)
	{
		isfloor5Sealed = "no";
	}
	if(m_btnFloor6Sealed.GetCheck() == 0)
	{
		isfloor6Sealed = "no";
	}
	if(m_btnFloor7Sealed.GetCheck() == 0)
	{
		isfloor7Sealed = "no";
	}
	if(m_btnFloor8Sealed.GetCheck() == 0)
	{
		isfloor8Sealed = "no";
	}
	if(m_btnFloor9Sealed.GetCheck() == 0)
	{
		isfloor9Sealed = "no";
	}
	if(m_btnFloor10Sealed.GetCheck() == 0)
	{
		isfloor10Sealed = "no";
	}

	//-------------------------
	// FLOORS AREA
	//-------------------------
	floor1Area = atof(str_editFloor1Area);
	floor2Area = atof(str_editFloor2Area);
	floor3Area = atof(str_editFloor3Area);
	floor4Area = atof(str_editFloor4Area);
	floor5Area = atof(str_editFloor5Area);
	floor6Area = atof(str_editFloor6Area);
	floor7Area = atof(str_editFloor7Area);
	floor8Area = atof(str_editFloor8Area);
	floor9Area = atof(str_editFloor9Area);
	floor10Area = atof(str_editFloor10Area);

	floor1Uvalue = atof(str_editFloor1Uvalue);
	floor2Uvalue = atof(str_editFloor2Uvalue);
	floor3Uvalue = atof(str_editFloor3Uvalue);
	floor4Uvalue = atof(str_editFloor4Uvalue);
	floor5Uvalue = atof(str_editFloor5Uvalue);
	floor6Uvalue = atof(str_editFloor6Uvalue);
	floor7Uvalue = atof(str_editFloor7Uvalue);
	floor8Uvalue = atof(str_editFloor8Uvalue);
	floor9Uvalue = atof(str_editFloor9Uvalue);
	floor10Uvalue = atof(str_editFloor10Uvalue);

	CheckFloorNameStrings();
}

void CDlg_Floors::OnCbnSelchangeCombo1()
{

	UpdateData(TRUE);
	m_comboFloor1Construction.ResetContent();

	if (str_comboFloor1Type == "Floor above unheated basement")
	{
		m_comboFloor1Construction.InsertString(0,"Solid upper floor");
		m_comboFloor1Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor1Type =="Floor of heated basement")
	{
		m_comboFloor1Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor1Type == "Ground")
	{
		m_comboFloor1Construction.InsertString(0,"Solid ground floor");
		m_comboFloor1Construction.InsertString(1,"Suspended concrete");
		m_comboFloor1Construction.InsertString(2,"Black beam high density");
		m_comboFloor1Construction.InsertString(3,"Black beam low density");
		m_comboFloor1Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor1Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor1Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor1Type == "Upper")
	{
		m_comboFloor1Construction.InsertString(0,"Solid upper floor");
		m_comboFloor1Construction.InsertString(1,"Timber upper floor");
	}
	

	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck1()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck3()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck5()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck13()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck8()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck9()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck15()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck16()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck17()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck19()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit12()
{
	int i = 0;

	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor1Name, lpszValidChars) != 0) 
	{
		str_editFloor1Name = " ";		
		m_comboFloor1Type.EnableWindow(FALSE);
		m_comboFloor1Construction.EnableWindow(FALSE);
		m_btnFloor1Sealed.EnableWindow(FALSE);
		m_editFloor1Area.EnableWindow(FALSE);
		m_editFloor1Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);        	
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}



void CDlg_Floors::OnEnChangeEdit15()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor2Name, lpszValidChars) != 0) 
	{
		str_editFloor2Name = " ";
		m_comboFloor2Type.EnableWindow(FALSE);
		m_comboFloor2Construction.EnableWindow(FALSE);
		m_btnFloor2Sealed.EnableWindow(FALSE);
		m_editFloor2Area.EnableWindow(FALSE);
		m_editFloor2Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit18()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor3Name, lpszValidChars) != 0) 
	{
		str_editFloor3Name = " ";
		m_comboFloor3Type.EnableWindow(FALSE);
		m_comboFloor3Construction.EnableWindow(FALSE);
		m_btnFloor3Sealed.EnableWindow(FALSE);
		m_editFloor3Area.EnableWindow(FALSE);
		m_editFloor3Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit21()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor4Name, lpszValidChars) != 0) 
	{
		str_editFloor4Name = " ";
		m_comboFloor4Type.EnableWindow(FALSE);
		m_comboFloor4Construction.EnableWindow(FALSE);
		m_btnFloor4Sealed.EnableWindow(FALSE);
		m_editFloor4Area.EnableWindow(FALSE);
		m_editFloor4Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit25()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor5Name, lpszValidChars) != 0) 
	{
		str_editFloor5Name = " ";
		m_comboFloor5Type.EnableWindow(FALSE);
		m_comboFloor5Construction.EnableWindow(FALSE);
		m_btnFloor5Sealed.EnableWindow(FALSE);
		m_editFloor5Area.EnableWindow(FALSE);
		m_editFloor5Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit28()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor6Name, lpszValidChars) != 0) 
	{
		str_editFloor6Name = " ";
		m_comboFloor6Type.EnableWindow(FALSE);
		m_comboFloor6Construction.EnableWindow(FALSE);
		m_btnFloor6Sealed.EnableWindow(FALSE);
		m_editFloor6Area.EnableWindow(FALSE);
		m_editFloor6Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit31()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor7Name, lpszValidChars) != 0) 
	{
		str_editFloor7Name = " ";
		m_comboFloor7Type.EnableWindow(FALSE);
		m_comboFloor7Construction.EnableWindow(FALSE);
		m_btnFloor7Sealed.EnableWindow(FALSE);
		m_editFloor7Area.EnableWindow(FALSE);
		m_editFloor7Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit34()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor8Name, lpszValidChars) != 0) 
	{
		str_editFloor8Name = " ";
		m_comboFloor8Type.EnableWindow(FALSE);
		m_comboFloor8Construction.EnableWindow(FALSE);
		m_btnFloor8Sealed.EnableWindow(FALSE);
		m_editFloor8Area.EnableWindow(FALSE);
		m_editFloor8Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit37()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor9Name, lpszValidChars) != 0) 
	{
		str_editFloor9Name = " ";
		m_comboFloor9Type.EnableWindow(FALSE);
		m_comboFloor9Construction.EnableWindow(FALSE);
		m_btnFloor9Sealed.EnableWindow(FALSE);
		m_editFloor9Area.EnableWindow(FALSE);
		m_editFloor9Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit40()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editFloor10Name, lpszValidChars) != 0) 
	{			
		str_editFloor10Name = " ";
		m_comboFloor10Type.EnableWindow(FALSE);
		m_comboFloor10Construction.EnableWindow(FALSE);
		m_btnFloor10Sealed.EnableWindow(FALSE);
		m_editFloor10Area.EnableWindow(FALSE);
		m_editFloor10Uvalue.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckFloorNameStrings();
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::CheckFloorNameStrings()
{
	//--------
	//FLOOR 1
	//--------
	if(str_editFloor1Name.IsEmpty())
	{	
		m_comboFloor1Type.EnableWindow(FALSE);
		m_comboFloor1Construction.EnableWindow(FALSE);
		m_btnFloor1Sealed.EnableWindow(FALSE);
		m_editFloor1Area.EnableWindow(FALSE);
		m_editFloor1Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor1Type.EnableWindow(TRUE);
		m_comboFloor1Construction.EnableWindow(TRUE);
		m_btnFloor1Sealed.EnableWindow(TRUE);
		m_editFloor1Area.EnableWindow(TRUE);
		m_editFloor1Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 2
	//--------
	if(str_editFloor2Name.IsEmpty())
	{	
		m_comboFloor2Type.EnableWindow(FALSE);
		m_comboFloor2Construction.EnableWindow(FALSE);
		m_btnFloor2Sealed.EnableWindow(FALSE);
		m_editFloor2Area.EnableWindow(FALSE);
		m_editFloor2Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor2Type.EnableWindow(TRUE);
		m_comboFloor2Construction.EnableWindow(TRUE);
		m_btnFloor2Sealed.EnableWindow(TRUE);
		m_editFloor2Area.EnableWindow(TRUE);
		m_editFloor2Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 3
	//--------
	if(str_editFloor3Name.IsEmpty())
	{	
		m_comboFloor3Type.EnableWindow(FALSE);
		m_comboFloor3Construction.EnableWindow(FALSE);
		m_btnFloor3Sealed.EnableWindow(FALSE);
		m_editFloor3Area.EnableWindow(FALSE);
		m_editFloor3Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor3Type.EnableWindow(TRUE);
		m_comboFloor3Construction.EnableWindow(TRUE);
		m_btnFloor3Sealed.EnableWindow(TRUE);
		m_editFloor3Area.EnableWindow(TRUE);
		m_editFloor3Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 4
	//--------
	if(str_editFloor4Name.IsEmpty())
	{	
		m_comboFloor4Type.EnableWindow(FALSE);
		m_comboFloor4Construction.EnableWindow(FALSE);
		m_btnFloor4Sealed.EnableWindow(FALSE);
		m_editFloor4Area.EnableWindow(FALSE);
		m_editFloor4Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor4Type.EnableWindow(TRUE);
		m_comboFloor4Construction.EnableWindow(TRUE);
		m_btnFloor4Sealed.EnableWindow(TRUE);
		m_editFloor4Area.EnableWindow(TRUE);
		m_editFloor4Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 5
	//--------
	if(str_editFloor5Name.IsEmpty())
	{	
		m_comboFloor5Type.EnableWindow(FALSE);
		m_comboFloor5Construction.EnableWindow(FALSE);
		m_btnFloor5Sealed.EnableWindow(FALSE);
		m_editFloor5Area.EnableWindow(FALSE);
		m_editFloor5Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor5Type.EnableWindow(TRUE);
		m_comboFloor5Construction.EnableWindow(TRUE);
		m_btnFloor5Sealed.EnableWindow(TRUE);
		m_editFloor5Area.EnableWindow(TRUE);
		m_editFloor5Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 6
	//--------
	if(str_editFloor6Name.IsEmpty())
	{	
		m_comboFloor6Type.EnableWindow(FALSE);
		m_comboFloor6Construction.EnableWindow(FALSE);
		m_btnFloor6Sealed.EnableWindow(FALSE);
		m_editFloor6Area.EnableWindow(FALSE);
		m_editFloor6Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor6Type.EnableWindow(TRUE);
		m_comboFloor6Construction.EnableWindow(TRUE);
		m_btnFloor6Sealed.EnableWindow(TRUE);
		m_editFloor6Area.EnableWindow(TRUE);
		m_editFloor6Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 7
	//--------
	if(str_editFloor7Name.IsEmpty())
	{	
		m_comboFloor7Type.EnableWindow(FALSE);
		m_comboFloor7Construction.EnableWindow(FALSE);
		m_btnFloor7Sealed.EnableWindow(FALSE);
		m_editFloor7Area.EnableWindow(FALSE);
		m_editFloor7Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor7Type.EnableWindow(TRUE);
		m_comboFloor7Construction.EnableWindow(TRUE);
		m_btnFloor7Sealed.EnableWindow(TRUE);
		m_editFloor7Area.EnableWindow(TRUE);
		m_editFloor7Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 8
	//--------
	if(str_editFloor8Name.IsEmpty())
	{	
		m_comboFloor8Type.EnableWindow(FALSE);
		m_comboFloor8Construction.EnableWindow(FALSE);
		m_btnFloor8Sealed.EnableWindow(FALSE);
		m_editFloor8Area.EnableWindow(FALSE);
		m_editFloor8Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor8Type.EnableWindow(TRUE);
		m_comboFloor8Construction.EnableWindow(TRUE);
		m_btnFloor8Sealed.EnableWindow(TRUE);
		m_editFloor8Area.EnableWindow(TRUE);
		m_editFloor8Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 9
	//--------
	if(str_editFloor9Name.IsEmpty())
	{	
		m_comboFloor9Type.EnableWindow(FALSE);
		m_comboFloor9Construction.EnableWindow(FALSE);
		m_btnFloor9Sealed.EnableWindow(FALSE);
		m_editFloor9Area.EnableWindow(FALSE);
		m_editFloor9Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor9Type.EnableWindow(TRUE);
		m_comboFloor9Construction.EnableWindow(TRUE);
		m_btnFloor9Sealed.EnableWindow(TRUE);
		m_editFloor9Area.EnableWindow(TRUE);
		m_editFloor9Uvalue.EnableWindow(TRUE);
	}

	//--------
	//FLOOR 10
	//--------
	if(str_editFloor10Name.IsEmpty())
	{	
		m_comboFloor10Type.EnableWindow(FALSE);
		m_comboFloor10Construction.EnableWindow(FALSE);
		m_btnFloor10Sealed.EnableWindow(FALSE);
		m_editFloor10Area.EnableWindow(FALSE);
		m_editFloor10Uvalue.EnableWindow(FALSE);		
	}
	else
	{
		m_comboFloor10Type.EnableWindow(TRUE);
		m_comboFloor10Construction.EnableWindow(TRUE);
		m_btnFloor10Sealed.EnableWindow(TRUE);
		m_editFloor10Area.EnableWindow(TRUE);
		m_editFloor10Uvalue.EnableWindow(TRUE);
	}
	UpdateData(FALSE); 	
}

void CDlg_Floors::OnCbnSelchangeCombo4()
{
	UpdateData(TRUE);
	m_comboFloor2Construction.ResetContent();

	if (str_comboFloor2Type == "Floor above unheated basement")
	{
		m_comboFloor2Construction.InsertString(0,"Solid upper floor");
		m_comboFloor2Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor2Type =="Floor of heated basement")
	{
		m_comboFloor2Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor2Type == "Ground")
	{
		m_comboFloor2Construction.InsertString(0,"Solid ground floor");
		m_comboFloor2Construction.InsertString(1,"Suspended concrete");
		m_comboFloor2Construction.InsertString(2,"Black beam high density");
		m_comboFloor2Construction.InsertString(3,"Black beam low density");
		m_comboFloor2Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor2Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor2Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor2Type == "Upper")
	{
		m_comboFloor2Construction.InsertString(0,"Solid upper floor");
		m_comboFloor2Construction.InsertString(1,"Timber upper floor");
	}
	

	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo12()
{
	UpdateData(TRUE);
	m_comboFloor3Construction.ResetContent();

	if (str_comboFloor3Type == "Floor above unheated basement")
	{
		m_comboFloor3Construction.InsertString(0,"Solid upper floor");
		m_comboFloor3Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor3Type =="Floor of heated basement")
	{
		m_comboFloor3Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor3Type == "Ground")
	{
		m_comboFloor3Construction.InsertString(0,"Solid ground floor");
		m_comboFloor3Construction.InsertString(1,"Suspended concrete");
		m_comboFloor3Construction.InsertString(2,"Black beam high density");
		m_comboFloor3Construction.InsertString(3,"Black beam low density");
		m_comboFloor3Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor3Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor3Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor3Type == "Upper")
	{
		m_comboFloor3Construction.InsertString(0,"Solid upper floor");
		m_comboFloor3Construction.InsertString(1,"Timber upper floor");
	}
	
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo14()
{
	UpdateData(TRUE);
	m_comboFloor4Construction.ResetContent();

	if (str_comboFloor4Type == "Floor above unheated basement")
	{
		m_comboFloor4Construction.InsertString(0,"Solid upper floor");
		m_comboFloor4Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor4Type =="Floor of heated basement")
	{
		m_comboFloor4Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor4Type == "Ground")
	{
		m_comboFloor4Construction.InsertString(0,"Solid ground floor");
		m_comboFloor4Construction.InsertString(1,"Suspended concrete");
		m_comboFloor4Construction.InsertString(2,"Black beam high density");
		m_comboFloor4Construction.InsertString(3,"Black beam low density");
		m_comboFloor4Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor4Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor4Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor4Type == "Upper")
	{
		m_comboFloor4Construction.InsertString(0,"Solid upper floor");
		m_comboFloor4Construction.InsertString(1,"Timber upper floor");
	}
	
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo16()
{

	UpdateData(TRUE);
	m_comboFloor5Construction.ResetContent();

	if (str_comboFloor5Type == "Floor above unheated basement")
	{
		m_comboFloor5Construction.InsertString(0,"Solid upper floor");
		m_comboFloor5Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor5Type =="Floor of heated basement")
	{
		m_comboFloor5Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor5Type == "Ground")
	{
		m_comboFloor5Construction.InsertString(0,"Solid ground floor");
		m_comboFloor5Construction.InsertString(1,"Suspended concrete");
		m_comboFloor5Construction.InsertString(2,"Black beam high density");
		m_comboFloor5Construction.InsertString(3,"Black beam low density");
		m_comboFloor5Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor5Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor5Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor5Type == "Upper")
	{
		m_comboFloor5Construction.InsertString(0,"Solid upper floor");
		m_comboFloor5Construction.InsertString(1,"Timber upper floor");
	}
	
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo18()
{
	UpdateData(TRUE);
	m_comboFloor6Construction.ResetContent();

	if (str_comboFloor6Type == "Floor above unheated basement")
	{
		m_comboFloor6Construction.InsertString(0,"Solid upper floor");
		m_comboFloor6Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor6Type =="Floor of heated basement")
	{
		m_comboFloor6Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor6Type == "Ground")
	{
		m_comboFloor6Construction.InsertString(0,"Solid ground floor");
		m_comboFloor6Construction.InsertString(1,"Suspended concrete");
		m_comboFloor6Construction.InsertString(2,"Black beam high density");
		m_comboFloor6Construction.InsertString(3,"Black beam low density");
		m_comboFloor6Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor6Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor6Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor6Type == "Upper")
	{
		m_comboFloor6Construction.InsertString(0,"Solid upper floor");
		m_comboFloor6Construction.InsertString(1,"Timber upper floor");
	}
	
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo20()
{
	UpdateData(TRUE);
	m_comboFloor7Construction.ResetContent();

	if (str_comboFloor7Type == "Floor above unheated basement")
	{
		m_comboFloor7Construction.InsertString(0,"Solid upper floor");
		m_comboFloor7Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor7Type =="Floor of heated basement")
	{
		m_comboFloor7Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor7Type == "Ground")
	{
		m_comboFloor7Construction.InsertString(0,"Solid ground floor");
		m_comboFloor7Construction.InsertString(1,"Suspended concrete");
		m_comboFloor7Construction.InsertString(2,"Black beam high density");
		m_comboFloor7Construction.InsertString(3,"Black beam low density");
		m_comboFloor7Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor7Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor7Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor7Type == "Upper")
	{
		m_comboFloor7Construction.InsertString(0,"Solid upper floor");
		m_comboFloor7Construction.InsertString(1,"Timber upper floor");
	}


	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo22()
{
	UpdateData(TRUE);
	m_comboFloor8Construction.ResetContent();

	if (str_comboFloor8Type == "Floor above unheated basement")
	{
		m_comboFloor8Construction.InsertString(0,"Solid upper floor");
		m_comboFloor8Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor8Type =="Floor of heated basement")
	{
		m_comboFloor8Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor8Type == "Ground")
	{
		m_comboFloor8Construction.InsertString(0,"Solid ground floor");
		m_comboFloor8Construction.InsertString(1,"Suspended concrete");
		m_comboFloor8Construction.InsertString(2,"Black beam high density");
		m_comboFloor8Construction.InsertString(3,"Black beam low density");
		m_comboFloor8Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor8Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor8Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor8Type == "Upper")
	{
		m_comboFloor8Construction.InsertString(0,"Solid upper floor");
		m_comboFloor8Construction.InsertString(1,"Timber upper floor");
	}

	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo24()
{
	UpdateData(TRUE);
	m_comboFloor9Construction.ResetContent();

	if (str_comboFloor9Type == "Floor above unheated basement")
	{
		m_comboFloor9Construction.InsertString(0,"Solid upper floor");
		m_comboFloor9Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor9Type =="Floor of heated basement")
	{
		m_comboFloor9Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor9Type == "Ground")
	{
		m_comboFloor9Construction.InsertString(0,"Solid ground floor");
		m_comboFloor9Construction.InsertString(1,"Suspended concrete");
		m_comboFloor9Construction.InsertString(2,"Black beam high density");
		m_comboFloor9Construction.InsertString(3,"Black beam low density");
		m_comboFloor9Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor9Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor9Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor9Type == "Upper")
	{
		m_comboFloor9Construction.InsertString(0,"Solid upper floor");
		m_comboFloor9Construction.InsertString(1,"Timber upper floor");
	}
	
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo26()
{
	UpdateData(TRUE);
	m_comboFloor10Construction.ResetContent();

	if (str_comboFloor10Type == "Floor above unheated basement")
	{
		m_comboFloor10Construction.InsertString(0,"Solid upper floor");
		m_comboFloor10Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor10Type =="Floor of heated basement")
	{
		m_comboFloor10Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor10Type == "Ground")
	{
		m_comboFloor10Construction.InsertString(0,"Solid ground floor");
		m_comboFloor10Construction.InsertString(1,"Suspended concrete");
		m_comboFloor10Construction.InsertString(2,"Black beam high density");
		m_comboFloor10Construction.InsertString(3,"Black beam low density");
		m_comboFloor10Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor10Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor10Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor10Type == "Upper")
	{
		m_comboFloor10Construction.InsertString(0,"Solid upper floor");
		m_comboFloor10Construction.InsertString(1,"Timber upper floor");
	}
	
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo3()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo11()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo13()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo15()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo17()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo19()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo21()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo23()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo25()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnCbnSelchangeCombo27()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck2()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck4()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck6()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck7()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck14()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck10()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck11()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck12()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck18()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnBnClickedCheck20()
{
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit13()
{
	//------------------------------------------------------------------------------
	// 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_editFloor1Area, lpszValidChars) != 0) 
	{
		str_editFloor1Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit16()
{
	//------------------------------------------------------------------------------
	// 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_editFloor2Area, lpszValidChars) != 0) 
	{
		str_editFloor2Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit19()
{
	//------------------------------------------------------------------------------
	// 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_editFloor3Area, lpszValidChars) != 0) 
	{
		str_editFloor3Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit22()
{
	//------------------------------------------------------------------------------
	// 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_editFloor4Area, lpszValidChars) != 0) 
	{
		str_editFloor4Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit26()
{
	//------------------------------------------------------------------------------
	// 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_editFloor5Area, lpszValidChars) != 0) 
	{
		str_editFloor5Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit29()
{
	//------------------------------------------------------------------------------
	// 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_editFloor6Area, lpszValidChars) != 0) 
	{
		str_editFloor6Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit32()
{
	//------------------------------------------------------------------------------
	// 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_editFloor7Area, lpszValidChars) != 0) 
	{
		str_editFloor7Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit35()
{
	//------------------------------------------------------------------------------
	// 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_editFloor8Area, lpszValidChars) != 0) 
	{
		str_editFloor8Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit38()
{
	//------------------------------------------------------------------------------
	// 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_editFloor9Area, lpszValidChars) != 0) 
	{
		str_editFloor9Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit41()
{
	//------------------------------------------------------------------------------
	// 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_editFloor10Area, lpszValidChars) != 0) 
	{
		str_editFloor10Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit14()
{
	//------------------------------------------------------------------------------
	// 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_editFloor1Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor1Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit17()
{
	//------------------------------------------------------------------------------
	// 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_editFloor2Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor2Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit20()
{
	//------------------------------------------------------------------------------
	// 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_editFloor3Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor3Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit23()
{
	//------------------------------------------------------------------------------
	// 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_editFloor4Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor4Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit27()
{
	//------------------------------------------------------------------------------
	// 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_editFloor5Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor5Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit30()
{
	//------------------------------------------------------------------------------
	// 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_editFloor6Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor6Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit33()
{
	//------------------------------------------------------------------------------
	// 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_editFloor7Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor7Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit36()
{
	//------------------------------------------------------------------------------
	// 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_editFloor8Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor8Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit39()
{
	//------------------------------------------------------------------------------
	// 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_editFloor9Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor9Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::OnEnChangeEdit42()
{
	//------------------------------------------------------------------------------
	// 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_editFloor10Uvalue, lpszValidChars) != 0) 
	{
		str_editFloor10Uvalue = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromFloorsDlg();
}

void CDlg_Floors::SelectStringsForFloorConstruction()
{
	//--------------------------------
	// FLOOR 1
	//--------------------------------
	if (str_comboFloor1Type == "Floor above unheated basement")
	{
		m_comboFloor1Construction.InsertString(0,"Solid upper floor");
		m_comboFloor1Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor1Type =="Floor of heated basement")
	{
		m_comboFloor1Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor1Type == "Ground")
	{
		m_comboFloor1Construction.InsertString(0,"Solid ground floor");
		m_comboFloor1Construction.InsertString(1,"Suspended concrete");
		m_comboFloor1Construction.InsertString(2,"Black beam high density");
		m_comboFloor1Construction.InsertString(3,"Black beam low density");
		m_comboFloor1Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor1Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor1Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor1Type == "Upper")
	{
		m_comboFloor1Construction.InsertString(0,"Solid upper floor");
		m_comboFloor1Construction.InsertString(1,"Timber upper floor");
	}
	

	//--------------------------------
	// FLOOR 2
	//--------------------------------
	if (str_comboFloor2Type == "Floor above unheated basement")
	{
		m_comboFloor2Construction.InsertString(0,"Solid upper floor");
		m_comboFloor2Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor2Type =="Floor of heated basement")
	{
		m_comboFloor2Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor2Type == "Ground")
	{
		m_comboFloor2Construction.InsertString(0,"Solid ground floor");
		m_comboFloor2Construction.InsertString(1,"Suspended concrete");
		m_comboFloor2Construction.InsertString(2,"Black beam high density");
		m_comboFloor2Construction.InsertString(3,"Black beam low density");
		m_comboFloor2Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor2Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor2Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor2Type == "Upper")
	{
		m_comboFloor2Construction.InsertString(0,"Solid upper floor");
		m_comboFloor2Construction.InsertString(1,"Timber upper floor");
	}


	//--------------------------------
	// FLOOR 3
	//--------------------------------
	if (str_comboFloor3Type == "Floor above unheated basement")
	{
		m_comboFloor3Construction.InsertString(0,"Solid upper floor");
		m_comboFloor3Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor3Type =="Floor of heated basement")
	{
		m_comboFloor3Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor3Type == "Ground")
	{
		m_comboFloor3Construction.InsertString(0,"Solid ground floor");
		m_comboFloor3Construction.InsertString(1,"Suspended concrete");
		m_comboFloor3Construction.InsertString(2,"Black beam high density");
		m_comboFloor3Construction.InsertString(3,"Black beam low density");
		m_comboFloor3Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor3Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor3Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor3Type == "Upper")
	{
		m_comboFloor3Construction.InsertString(0,"Solid upper floor");
		m_comboFloor3Construction.InsertString(1,"Timber upper floor");
	}


	//--------------------------------
	// FLOOR 4
	//--------------------------------
	if (str_comboFloor4Type == "Floor above unheated basement")
	{
		m_comboFloor4Construction.InsertString(0,"Solid upper floor");
		m_comboFloor4Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor4Type =="Floor of heated basement")
	{
		m_comboFloor4Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor4Type == "Ground")
	{
		m_comboFloor4Construction.InsertString(0,"Solid ground floor");
		m_comboFloor4Construction.InsertString(1,"Suspended concrete");
		m_comboFloor4Construction.InsertString(2,"Black beam high density");
		m_comboFloor4Construction.InsertString(3,"Black beam low density");
		m_comboFloor4Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor4Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor4Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor4Type == "Upper")
	{
		m_comboFloor4Construction.InsertString(0,"Solid upper floor");
		m_comboFloor4Construction.InsertString(1,"Timber upper floor");
	}


	//--------------------------------
	// FLOOR 5
	//--------------------------------
	if (str_comboFloor5Type == "Floor above unheated basement")
	{
		m_comboFloor5Construction.InsertString(0,"Solid upper floor");
		m_comboFloor5Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor5Type =="Floor of heated basement")
	{
		m_comboFloor5Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor5Type == "Ground")
	{
		m_comboFloor5Construction.InsertString(0,"Solid ground floor");
		m_comboFloor5Construction.InsertString(1,"Suspended concrete");
		m_comboFloor5Construction.InsertString(2,"Black beam high density");
		m_comboFloor5Construction.InsertString(3,"Black beam low density");
		m_comboFloor5Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor5Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor5Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor5Type == "Upper")
	{
		m_comboFloor5Construction.InsertString(0,"Solid upper floor");
		m_comboFloor5Construction.InsertString(1,"Timber upper floor");
	}


	//--------------------------------
	// FLOOR 6
	//--------------------------------
	if (str_comboFloor6Type == "Floor above unheated basement")
	{
		m_comboFloor6Construction.InsertString(0,"Solid upper floor");
		m_comboFloor6Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor6Type =="Floor of heated basement")
	{
		m_comboFloor6Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor6Type == "Ground")
	{
		m_comboFloor6Construction.InsertString(0,"Solid ground floor");
		m_comboFloor6Construction.InsertString(1,"Suspended concrete");
		m_comboFloor6Construction.InsertString(2,"Black beam high density");
		m_comboFloor6Construction.InsertString(3,"Black beam low density");
		m_comboFloor6Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor6Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor6Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor6Type == "Upper")
	{
		m_comboFloor6Construction.InsertString(0,"Solid upper floor");
		m_comboFloor6Construction.InsertString(1,"Timber upper floor");
	}


	//--------------------------------
	// FLOOR 7
	//--------------------------------
	if (str_comboFloor7Type == "Floor above unheated basement")
	{
		m_comboFloor7Construction.InsertString(0,"Solid upper floor");
		m_comboFloor7Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor7Type =="Floor of heated basement")
	{
		m_comboFloor7Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor7Type == "Ground")
	{
		m_comboFloor7Construction.InsertString(0,"Solid ground floor");
		m_comboFloor7Construction.InsertString(1,"Suspended concrete");
		m_comboFloor7Construction.InsertString(2,"Black beam high density");
		m_comboFloor7Construction.InsertString(3,"Black beam low density");
		m_comboFloor7Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor7Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor7Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor7Type == "Upper")
	{
		m_comboFloor7Construction.InsertString(0,"Solid upper floor");
		m_comboFloor7Construction.InsertString(1,"Timber upper floor");
	}


	//--------------------------------
	// FLOOR 8
	//--------------------------------
	if (str_comboFloor8Type == "Floor above unheated basement")
	{
		m_comboFloor8Construction.InsertString(0,"Solid upper floor");
		m_comboFloor8Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor8Type =="Floor of heated basement")
	{
		m_comboFloor8Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor8Type == "Ground")
	{
		m_comboFloor8Construction.InsertString(0,"Solid ground floor");
		m_comboFloor8Construction.InsertString(1,"Suspended concrete");
		m_comboFloor8Construction.InsertString(2,"Black beam high density");
		m_comboFloor8Construction.InsertString(3,"Black beam low density");
		m_comboFloor8Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor8Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor8Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor8Type == "Upper")
	{
		m_comboFloor8Construction.InsertString(0,"Solid upper floor");
		m_comboFloor8Construction.InsertString(1,"Timber upper floor");
	}
	

	//--------------------------------
	// FLOOR 9
	//--------------------------------
	if (str_comboFloor9Type == "Floor above unheated basement")
	{
		m_comboFloor9Construction.InsertString(0,"Solid upper floor");
		m_comboFloor9Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor9Type =="Floor of heated basement")
	{
		m_comboFloor9Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor9Type == "Ground")
	{
		m_comboFloor9Construction.InsertString(0,"Solid ground floor");
		m_comboFloor9Construction.InsertString(1,"Suspended concrete");
		m_comboFloor9Construction.InsertString(2,"Black beam high density");
		m_comboFloor9Construction.InsertString(3,"Black beam low density");
		m_comboFloor9Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor9Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor9Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor9Type == "Upper")
	{
		m_comboFloor9Construction.InsertString(0,"Solid upper floor");
		m_comboFloor9Construction.InsertString(1,"Timber upper floor");
	}

	//--------------------------------
	// FLOOR 10
	//--------------------------------
	if (str_comboFloor10Type == "Floor above unheated basement")
	{
		m_comboFloor10Construction.InsertString(0,"Solid upper floor");
		m_comboFloor10Construction.InsertString(1,"Timber upper floor");
	}
	else if (str_comboFloor10Type =="Floor of heated basement")
	{
		m_comboFloor10Construction.InsertString(0,"Solid ground floor");
	}
	else if (str_comboFloor10Type == "Ground")
	{
		m_comboFloor10Construction.InsertString(0,"Solid ground floor");
		m_comboFloor10Construction.InsertString(1,"Suspended concrete");
		m_comboFloor10Construction.InsertString(2,"Black beam high density");
		m_comboFloor10Construction.InsertString(3,"Black beam low density");
		m_comboFloor10Construction.InsertString(4,"Black beam polystyrene");
		m_comboFloor10Construction.InsertString(5,"Suspended timber with ins between");
		m_comboFloor10Construction.InsertString(6,"Suspended timber with ins below");
	}
	else if (str_comboFloor10Type == "Upper")
	{
		m_comboFloor10Construction.InsertString(0,"Solid upper floor");
		m_comboFloor10Construction.InsertString(1,"Timber upper floor");
	}

}

BOOL CDlg_Floors::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);
}