// Dlg_Walls.cpp : implementation file
//

#include "stdafx.h"
#include "SAPP1.h"
#include "Dlg_Walls.h"
#include "SAPP1Dlg.h"
#include "Dlg_WindowRoofOpenings.h"


// CDlg_Walls dialog

IMPLEMENT_DYNAMIC(CDlg_Walls, CDialog)
CDlg_Walls::CDlg_Walls(CWnd* pParent /*=NULL*/)
	: CDialog(CDlg_Walls::IDD, pParent)
	, str_editWall1Name(_T(""))
	, str_editWall2Name(_T(""))
	, str_editWall3Name(_T(""))
	, str_editWall4Name(_T(""))
	, str_editWall5Name(_T(""))
	, str_editWall6Name(_T(""))
	, str_editWall7Name(_T(""))
	, str_editWall8Name(_T(""))
	, str_editWall9Name(_T(""))
	, str_editWall10Name(_T(""))
	, str_comboWall1Construction(_T(""))
	, str_comboWall2Construction(_T(""))
	, str_comboWall3Construction(_T(""))
	, str_comboWall4Construction(_T(""))
	, str_comboWall5Construction(_T(""))
	, str_comboWall6Construction(_T(""))
	, str_comboWall7Construction(_T(""))
	, str_comboWall8Construction(_T(""))
	, str_comboWall9Construction(_T(""))
	, str_comboWall10Construction(_T(""))
	, str_comboWall1Basement(_T(""))
	, str_comboWall2Basement(_T(""))
	, str_comboWall3Basement(_T(""))
	, str_comboWall4Basement(_T(""))
	, str_comboWall5Basement(_T(""))
	, str_comboWall6Basement(_T(""))
	, str_comboWall7Basement(_T(""))
	, str_comboWall8Basement(_T(""))
	, str_comboWall9Basement(_T(""))
	, str_comboWall10Basement(_T(""))
	, str_editWall1Area(_T(""))
	, str_editWall2Area(_T(""))
	, str_editWall3Area(_T(""))
	, str_editWall4Area(_T(""))
	, str_editWall5Area(_T(""))
	, str_editWall6Area(_T(""))
	, str_editWall7Area(_T(""))
	, str_editWall8Area(_T(""))
	, str_editWall9Area(_T(""))
	, str_editWall10Area(_T(""))
	, str_editWall1Uvalue(_T(""))
	, str_editWall2Uvalue(_T(""))
	, str_editWall3Uvalue(_T(""))
	, str_editWall4Uvalue(_T(""))
	, str_editWall5Uvalue(_T(""))
	, str_editWall6Uvalue(_T(""))
	, str_editWall7Uvalue(_T(""))
	, str_editWall8Uvalue(_T(""))
	, str_editWall9Uvalue(_T(""))
	, str_editWall10Uvalue(_T(""))
{
}

CDlg_Walls::~CDlg_Walls()
{
}

void CDlg_Walls::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_STATIC_1, m_labelHLWalls);
	DDX_Control(pDX, IDC_CHECK1, m_btnWall1);
	DDX_Control(pDX, IDC_CHECK3, m_btnWall2);
	DDX_Control(pDX, IDC_CHECK5, m_btnWall3);
	DDX_Control(pDX, IDC_CHECK13, m_btnWall4);
	DDX_Control(pDX, IDC_CHECK8, m_btnWall5);
	DDX_Control(pDX, IDC_CHECK9, m_btnWall6);
	DDX_Control(pDX, IDC_CHECK15, m_btnWall7);
	DDX_Control(pDX, IDC_CHECK16, m_btnWall8);
	DDX_Control(pDX, IDC_CHECK17, m_btnWall9);
	DDX_Control(pDX, IDC_CHECK19, m_btnWall10);
	DDX_Control(pDX, IDC_EDIT12, m_editWall1Name);
	DDX_Control(pDX, IDC_EDIT15, m_editWall2Name);
	DDX_Control(pDX, IDC_EDIT18, m_editWall3Name);
	DDX_Control(pDX, IDC_EDIT21, m_editWall4Name);
	DDX_Control(pDX, IDC_EDIT25, m_editWall5Name);
	DDX_Control(pDX, IDC_EDIT28, m_editWall6Name);
	DDX_Control(pDX, IDC_EDIT31, m_editWall7Name);
	DDX_Control(pDX, IDC_EDIT34, m_editWall8Name);
	DDX_Control(pDX, IDC_EDIT37, m_editWall9Name);
	DDX_Control(pDX, IDC_EDIT40, m_editWall10Name);
	DDX_Control(pDX, IDC_COMBO1, m_comboWall1Construction);
	DDX_Control(pDX, IDC_COMBO4, m_comboWall2Construction);
	DDX_Control(pDX, IDC_COMBO12, m_comboWall3Construction);
	DDX_Control(pDX, IDC_COMBO14, m_comboWall4Construction);
	DDX_Control(pDX, IDC_COMBO16, m_comboWall5Construction);
	DDX_Control(pDX, IDC_COMBO18, m_comboWall6Construction);
	DDX_Control(pDX, IDC_COMBO20, m_comboWall7Construction);
	DDX_Control(pDX, IDC_COMBO22, m_comboWall8Construction);
	DDX_Control(pDX, IDC_COMBO24, m_comboWall9Construction);
	DDX_Control(pDX, IDC_COMBO26, m_comboWall10Construction);
	DDX_Control(pDX, IDC_COMBO3, m_comboWall1Basement);
	DDX_Control(pDX, IDC_COMBO11, m_comboWall2Basement);
	DDX_Control(pDX, IDC_COMBO13, m_comboWall3Basement);
	DDX_Control(pDX, IDC_COMBO15, m_comboWall4Basement);
	DDX_Control(pDX, IDC_COMBO17, m_comboWall5Basement);
	DDX_Control(pDX, IDC_COMBO19, m_comboWall6Basement);
	DDX_Control(pDX, IDC_COMBO21, m_comboWall7Basement);
	DDX_Control(pDX, IDC_COMBO23, m_comboWall8Basement);
	DDX_Control(pDX, IDC_COMBO25, m_comboWall9Basement);
	DDX_Control(pDX, IDC_COMBO27, m_comboWall10Basement);
	DDX_Control(pDX, IDC_EDIT13, m_editWall1Area);
	DDX_Control(pDX, IDC_EDIT16, m_editWall2Area);
	DDX_Control(pDX, IDC_EDIT19, m_editWall3Area);
	DDX_Control(pDX, IDC_EDIT22, m_editWall4Area);
	DDX_Control(pDX, IDC_EDIT26, m_editWall5Area);
	DDX_Control(pDX, IDC_EDIT29, m_editWall6Area);
	DDX_Control(pDX, IDC_EDIT32, m_editWall7Area);
	DDX_Control(pDX, IDC_EDIT35, m_editWall8Area);
	DDX_Control(pDX, IDC_EDIT38, m_editWall9Area);
	DDX_Control(pDX, IDC_EDIT41, m_editWall10Area);
	DDX_Control(pDX, IDC_EDIT14, m_editWall1Uvalue);
	DDX_Control(pDX, IDC_EDIT17, m_editWall2Uvalue);
	DDX_Control(pDX, IDC_EDIT20, m_editWall3Uvalue);
	DDX_Control(pDX, IDC_EDIT23, m_editWall4Uvalue);
	DDX_Control(pDX, IDC_EDIT27, m_editWall5Uvalue);
	DDX_Control(pDX, IDC_EDIT30, m_editWall6Uvalue);
	DDX_Control(pDX, IDC_EDIT33, m_editWall7Uvalue);
	DDX_Control(pDX, IDC_EDIT36, m_editWall8Uvalue);
	DDX_Control(pDX, IDC_EDIT39, m_editWall9Uvalue);
	DDX_Control(pDX, IDC_EDIT42, m_editWall10Uvalue);
	DDX_Text(pDX, IDC_EDIT12, str_editWall1Name);
	DDX_Text(pDX, IDC_EDIT15, str_editWall2Name);
	DDX_Text(pDX, IDC_EDIT18, str_editWall3Name);
	DDX_Text(pDX, IDC_EDIT21, str_editWall4Name);
	DDX_Text(pDX, IDC_EDIT25, str_editWall5Name);
	DDX_Text(pDX, IDC_EDIT28, str_editWall6Name);
	DDX_Text(pDX, IDC_EDIT31, str_editWall7Name);
	DDX_Text(pDX, IDC_EDIT34, str_editWall8Name);
	DDX_Text(pDX, IDC_EDIT37, str_editWall9Name);
	DDX_Text(pDX, IDC_EDIT40, str_editWall10Name);
	DDX_CBString(pDX, IDC_COMBO1, str_comboWall1Construction);
	DDX_CBString(pDX, IDC_COMBO4, str_comboWall2Construction);
	DDX_CBString(pDX, IDC_COMBO12, str_comboWall3Construction);
	DDX_CBString(pDX, IDC_COMBO14, str_comboWall4Construction);
	DDX_CBString(pDX, IDC_COMBO16, str_comboWall5Construction);
	DDX_CBString(pDX, IDC_COMBO18, str_comboWall6Construction);
	DDX_CBString(pDX, IDC_COMBO20, str_comboWall7Construction);
	DDX_CBString(pDX, IDC_COMBO22, str_comboWall8Construction);
	DDX_CBString(pDX, IDC_COMBO24, str_comboWall9Construction);
	DDX_CBString(pDX, IDC_COMBO26, str_comboWall10Construction);
	DDX_CBString(pDX, IDC_COMBO3, str_comboWall1Basement);
	DDX_CBString(pDX, IDC_COMBO11, str_comboWall2Basement);
	DDX_CBString(pDX, IDC_COMBO13, str_comboWall3Basement);
	DDX_CBString(pDX, IDC_COMBO15, str_comboWall4Basement);
	DDX_CBString(pDX, IDC_COMBO17, str_comboWall5Basement);
	DDX_CBString(pDX, IDC_COMBO19, str_comboWall6Basement);
	DDX_CBString(pDX, IDC_COMBO21, str_comboWall7Basement);
	DDX_CBString(pDX, IDC_COMBO23, str_comboWall8Basement);
	DDX_CBString(pDX, IDC_COMBO25, str_comboWall9Basement);
	DDX_CBString(pDX, IDC_COMBO27, str_comboWall10Basement);
	DDX_Text(pDX, IDC_EDIT13, str_editWall1Area);
	DDX_Text(pDX, IDC_EDIT16, str_editWall2Area);
	DDX_Text(pDX, IDC_EDIT19, str_editWall3Area);
	DDX_Text(pDX, IDC_EDIT22, str_editWall4Area);
	DDX_Text(pDX, IDC_EDIT26, str_editWall5Area);
	DDX_Text(pDX, IDC_EDIT29, str_editWall6Area);
	DDX_Text(pDX, IDC_EDIT32, str_editWall7Area);
	DDX_Text(pDX, IDC_EDIT35, str_editWall8Area);
	DDX_Text(pDX, IDC_EDIT38, str_editWall9Area);
	DDX_Text(pDX, IDC_EDIT41, str_editWall10Area);
	DDX_Text(pDX, IDC_EDIT14, str_editWall1Uvalue);
	DDX_Text(pDX, IDC_EDIT17, str_editWall2Uvalue);
	DDX_Text(pDX, IDC_EDIT20, str_editWall3Uvalue);
	DDX_Text(pDX, IDC_EDIT23, str_editWall4Uvalue);
	DDX_Text(pDX, IDC_EDIT27, str_editWall5Uvalue);
	DDX_Text(pDX, IDC_EDIT30, str_editWall6Uvalue);
	DDX_Text(pDX, IDC_EDIT33, str_editWall7Uvalue);
	DDX_Text(pDX, IDC_EDIT36, str_editWall8Uvalue);
	DDX_Text(pDX, IDC_EDIT39, str_editWall9Uvalue);
	DDX_Text(pDX, IDC_EDIT42, str_editWall10Uvalue);
	DDX_Control(pDX, IDC_BUTTON3, m_openingWall1);
	DDX_Control(pDX, IDC_BUTTON4, m_openingWall2);
	DDX_Control(pDX, IDC_BUTTON5, m_openingWall3);
	DDX_Control(pDX, IDC_BUTTON6, m_openingWall4);
	DDX_Control(pDX, IDC_BUTTON7, m_openingWall5);
	DDX_Control(pDX, IDC_BUTTON8, m_openingWall6);
	DDX_Control(pDX, IDC_BUTTON9, m_openingWall7);
	DDX_Control(pDX, IDC_BUTTON10, m_openingWall8);
	DDX_Control(pDX, IDC_BUTTON11, m_openingWall9);
	DDX_Control(pDX, IDC_BUTTON12, m_openingWall10);
}


BEGIN_MESSAGE_MAP(CDlg_Walls, CDialog)
	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_COMBO1, OnCbnSelchangeCombo1)
	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_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)
	ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3)
	ON_BN_CLICKED(IDC_BUTTON4, OnBnClickedButton4)
	ON_BN_CLICKED(IDC_BUTTON5, OnBnClickedButton5)
	ON_BN_CLICKED(IDC_BUTTON6, OnBnClickedButton6)
	ON_BN_CLICKED(IDC_BUTTON7, OnBnClickedButton7)
	ON_BN_CLICKED(IDC_BUTTON8, OnBnClickedButton8)
	ON_BN_CLICKED(IDC_BUTTON9, OnBnClickedButton9)
	ON_BN_CLICKED(IDC_BUTTON10, OnBnClickedButton10)
	ON_BN_CLICKED(IDC_BUTTON11, OnBnClickedButton11)
	ON_BN_CLICKED(IDC_BUTTON12, OnBnClickedButton12)
END_MESSAGE_MAP()


// CDlg_Walls message handlers



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

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

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

	AddStringsToComboBoxesForWallsDlg();

	if(file_new_selected ==true)
	{
		//------------------------------------------
		//	WALL NAME
		//------------------------------------------
		wall1Name = " "; 
		wall2Name = " "; 
		wall3Name = " "; 
		wall4Name = " "; 
		wall5Name = " "; 
		wall6Name = " "; 
		wall7Name = " "; 
		wall8Name = " "; 
		wall9Name = " "; 
		wall10Name = " "; 

		//------------------------------------------
		//	WALL CONSTRUCTION
		//------------------------------------------
		wall1Construction = " "; 
		wall2Construction = " "; 
		wall3Construction = " "; 
		wall4Construction = " "; 
		wall5Construction = " "; 
		wall6Construction = " "; 
		wall7Construction = " "; 
		wall8Construction = " "; 
		wall9Construction = " "; 
		wall10Construction = " "; 

		//------------------------------------------
		//	WALL BASEMENT
		//------------------------------------------
		wall1Basement = " "; 
		wall2Basement = " "; 
		wall3Basement = " "; 
		wall4Basement = " "; 
		wall5Basement = " "; 
		wall6Basement = " "; 
		wall7Basement = " "; 
		wall8Basement = " "; 
		wall9Basement = " "; 
		wall10Basement = " "; 

		//------------------------------------------
		//	WALL AREA
		//------------------------------------------
		wall1Area = 0;
		wall2Area = 0;
		wall3Area = 0;
		wall4Area = 0;
		wall5Area = 0;
		wall6Area = 0;
		wall7Area = 0;
		wall8Area = 0;
		wall9Area = 0;
		wall10Area = 0;

		//------------------------------------------
		//	WALL U-VALUE
		//------------------------------------------
		wall1Uvalue = 0;
		wall2Uvalue = 0;
		wall3Uvalue = 0;
		wall4Uvalue = 0;
		wall5Uvalue = 0;
		wall6Uvalue = 0;
		wall7Uvalue = 0;
		wall8Uvalue = 0;
		wall9Uvalue = 0;
		wall10Uvalue = 0;
	}

	ReadPreviousInputsFromWallsDlg();
	return TRUE;
}

void CDlg_Walls::CheckWallNameStrings()
{
	//--------
	//WALL 1
	//--------
	if(wall1Name.IsEmpty())
	{
		m_comboWall1Construction.EnableWindow(FALSE);
		m_comboWall1Basement.EnableWindow(FALSE);
		m_editWall1Area.EnableWindow(FALSE);
		m_editWall1Uvalue.EnableWindow(FALSE);
		m_openingWall1.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall1Construction.EnableWindow(TRUE);
		m_comboWall1Basement.EnableWindow(TRUE);
		m_editWall1Area.EnableWindow(TRUE);
		m_editWall1Uvalue.EnableWindow(TRUE);
		m_openingWall1.EnableWindow(TRUE);
	}

	//--------
	//WALL 2
	//--------
	if(wall2Name.IsEmpty())
	{
		m_comboWall2Construction.EnableWindow(FALSE);
		m_comboWall2Basement.EnableWindow(FALSE);
		m_editWall2Area.EnableWindow(FALSE);
		m_editWall2Uvalue.EnableWindow(FALSE);
		m_openingWall2.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall2Construction.EnableWindow(TRUE);
		m_comboWall2Basement.EnableWindow(TRUE);
		m_editWall2Area.EnableWindow(TRUE);
		m_editWall2Uvalue.EnableWindow(TRUE);
		m_openingWall2.EnableWindow(TRUE);
	}

	//--------
	//WALL 3
	//--------
	if(wall3Name.IsEmpty())
	{
		m_comboWall3Construction.EnableWindow(FALSE);
		m_comboWall3Basement.EnableWindow(FALSE);
		m_editWall3Area.EnableWindow(FALSE);
		m_editWall3Uvalue.EnableWindow(FALSE);
		m_openingWall3.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall3Construction.EnableWindow(TRUE);
		m_comboWall3Basement.EnableWindow(TRUE);
		m_editWall3Area.EnableWindow(TRUE);
		m_editWall3Uvalue.EnableWindow(TRUE);
		m_openingWall3.EnableWindow(TRUE);
	}

	//--------
	//WALL 4
	//--------
	if(wall4Name.IsEmpty())
	{
		m_comboWall4Construction.EnableWindow(FALSE);
		m_comboWall4Basement.EnableWindow(FALSE);
		m_editWall4Area.EnableWindow(FALSE);
		m_editWall4Uvalue.EnableWindow(FALSE);
		m_openingWall4.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall4Construction.EnableWindow(TRUE);
		m_comboWall4Basement.EnableWindow(TRUE);
		m_editWall4Area.EnableWindow(TRUE);
		m_editWall4Uvalue.EnableWindow(TRUE);
		m_openingWall4.EnableWindow(TRUE);
	}

	//--------
	//WALL 5
	//--------
	if(wall5Name.IsEmpty())
	{
		m_comboWall5Construction.EnableWindow(FALSE);
		m_comboWall5Basement.EnableWindow(FALSE);
		m_editWall5Area.EnableWindow(FALSE);
		m_editWall5Uvalue.EnableWindow(FALSE);
		m_openingWall5.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall5Construction.EnableWindow(TRUE);
		m_comboWall5Basement.EnableWindow(TRUE);
		m_editWall5Area.EnableWindow(TRUE);
		m_editWall5Uvalue.EnableWindow(TRUE);
		m_openingWall5.EnableWindow(TRUE);
	}

	//--------
	//WALL 6
	//--------
	if(wall6Name.IsEmpty())
	{
		m_comboWall6Construction.EnableWindow(FALSE);
		m_comboWall6Basement.EnableWindow(FALSE);
		m_editWall6Area.EnableWindow(FALSE);
		m_editWall6Uvalue.EnableWindow(FALSE);
		m_openingWall6.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall6Construction.EnableWindow(TRUE);
		m_comboWall6Basement.EnableWindow(TRUE);
		m_editWall6Area.EnableWindow(TRUE);
		m_editWall6Uvalue.EnableWindow(TRUE);
		m_openingWall6.EnableWindow(TRUE);
	}

	//--------
	//WALL 7
	//--------
	if(wall7Name.IsEmpty())
	{
		m_comboWall7Construction.EnableWindow(FALSE);
		m_comboWall7Basement.EnableWindow(FALSE);
		m_editWall7Area.EnableWindow(FALSE);
		m_editWall7Uvalue.EnableWindow(FALSE);
		m_openingWall7.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall7Construction.EnableWindow(TRUE);
		m_comboWall7Basement.EnableWindow(TRUE);
		m_editWall7Area.EnableWindow(TRUE);
		m_editWall7Uvalue.EnableWindow(TRUE);
		m_openingWall7.EnableWindow(TRUE);
	}

	//--------
	//WALL 8
	//--------
	if(wall8Name.IsEmpty())
	{
		m_comboWall8Construction.EnableWindow(FALSE);
		m_comboWall8Basement.EnableWindow(FALSE);
		m_editWall8Area.EnableWindow(FALSE);
		m_editWall8Uvalue.EnableWindow(FALSE);
		m_openingWall8.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall8Construction.EnableWindow(TRUE);
		m_comboWall8Basement.EnableWindow(TRUE);
		m_editWall8Area.EnableWindow(TRUE);
		m_editWall8Uvalue.EnableWindow(TRUE);
		m_openingWall8.EnableWindow(TRUE);
	}

	//--------
	//WALL 9
	//--------
	if(wall9Name.IsEmpty())
	{
		m_comboWall9Construction.EnableWindow(FALSE);
		m_comboWall9Basement.EnableWindow(FALSE);
		m_editWall9Area.EnableWindow(FALSE);
		m_editWall9Uvalue.EnableWindow(FALSE);
		m_openingWall9.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall9Construction.EnableWindow(TRUE);
		m_comboWall9Basement.EnableWindow(TRUE);
		m_editWall9Area.EnableWindow(TRUE);
		m_editWall9Uvalue.EnableWindow(TRUE);
		m_openingWall9.EnableWindow(TRUE);
	}

	//--------
	//WALL 10
	//--------
	if(wall10Name.IsEmpty())
	{
		m_comboWall10Construction.EnableWindow(FALSE);
		m_comboWall10Basement.EnableWindow(FALSE);
		m_editWall10Area.EnableWindow(FALSE);
		m_editWall10Uvalue.EnableWindow(FALSE);
		m_openingWall10.EnableWindow(FALSE);
	}
	else
	{
		m_comboWall10Construction.EnableWindow(TRUE);
		m_comboWall10Basement.EnableWindow(TRUE);
		m_editWall10Area.EnableWindow(TRUE);
		m_editWall10Uvalue.EnableWindow(TRUE);
		m_openingWall10.EnableWindow(TRUE);
	}

}
void CDlg_Walls::AddStringsToComboBoxesForWallsDlg()
{
	//--------------------------------
	// WALL CONSTRUCTION
	//--------------------------------
	m_comboWall1Construction.InsertString(0,"Stone");
	m_comboWall1Construction.InsertString(1,"Brick");
	m_comboWall1Construction.InsertString(2,"Cavity");
	m_comboWall1Construction.InsertString(3,"Timber");
	m_comboWall1Construction.InsertString(4,"System build");
	m_comboWall1Construction.InsertString(5,"Curtain walling");	

	m_comboWall2Construction.InsertString(0,"Stone");
	m_comboWall2Construction.InsertString(1,"Brick");
	m_comboWall2Construction.InsertString(2,"Cavity");
	m_comboWall2Construction.InsertString(3,"Timber");
	m_comboWall2Construction.InsertString(4,"System build");
	m_comboWall2Construction.InsertString(5,"Curtain walling");	

	m_comboWall3Construction.InsertString(0,"Stone");
	m_comboWall3Construction.InsertString(1,"Brick");
	m_comboWall3Construction.InsertString(2,"Cavity");
	m_comboWall3Construction.InsertString(3,"Timber");
	m_comboWall3Construction.InsertString(4,"System build");
	m_comboWall3Construction.InsertString(5,"Curtain walling");	

	m_comboWall4Construction.InsertString(0,"Stone");
	m_comboWall4Construction.InsertString(1,"Brick");
	m_comboWall4Construction.InsertString(2,"Cavity");
	m_comboWall4Construction.InsertString(3,"Timber");
	m_comboWall4Construction.InsertString(4,"System build");
	m_comboWall4Construction.InsertString(5,"Curtain walling");	

	m_comboWall5Construction.InsertString(0,"Stone");
	m_comboWall5Construction.InsertString(1,"Brick");
	m_comboWall5Construction.InsertString(2,"Cavity");
	m_comboWall5Construction.InsertString(3,"Timber");
	m_comboWall5Construction.InsertString(4,"System build");
	m_comboWall5Construction.InsertString(5,"Curtain walling");	

	m_comboWall6Construction.InsertString(0,"Stone");
	m_comboWall6Construction.InsertString(1,"Brick");
	m_comboWall6Construction.InsertString(2,"Cavity");
	m_comboWall6Construction.InsertString(3,"Timber");
	m_comboWall6Construction.InsertString(4,"System build");
	m_comboWall6Construction.InsertString(5,"Curtain walling");	

	m_comboWall7Construction.InsertString(0,"Stone");
	m_comboWall7Construction.InsertString(1,"Brick");
	m_comboWall7Construction.InsertString(2,"Cavity");
	m_comboWall7Construction.InsertString(3,"Timber");
	m_comboWall7Construction.InsertString(4,"System build");
	m_comboWall7Construction.InsertString(5,"Curtain walling");	

	m_comboWall8Construction.InsertString(0,"Stone");
	m_comboWall8Construction.InsertString(1,"Brick");
	m_comboWall8Construction.InsertString(2,"Cavity");
	m_comboWall8Construction.InsertString(3,"Timber");
	m_comboWall8Construction.InsertString(4,"System build");
	m_comboWall8Construction.InsertString(5,"Curtain walling");	

	m_comboWall9Construction.InsertString(0,"Stone");
	m_comboWall9Construction.InsertString(1,"Brick");
	m_comboWall9Construction.InsertString(2,"Cavity");
	m_comboWall9Construction.InsertString(3,"Timber");
	m_comboWall9Construction.InsertString(4,"System build");
	m_comboWall9Construction.InsertString(5,"Curtain walling");	

	m_comboWall10Construction.InsertString(0,"Stone");
	m_comboWall10Construction.InsertString(1,"Brick");
	m_comboWall10Construction.InsertString(2,"Cavity");
	m_comboWall10Construction.InsertString(3,"Timber");
	m_comboWall10Construction.InsertString(4,"System build");
	m_comboWall10Construction.InsertString(5,"Curtain walling");

	//--------------------------------
	// WALL BASEMENT
	//--------------------------------
	m_comboWall1Basement.InsertString(0,"No basement present");
	m_comboWall1Basement.InsertString(1,"Unconnected to basement");
	m_comboWall1Basement.InsertString(2,"Directly above basement");
	m_comboWall1Basement.InsertString(3,"In heated basement");

	m_comboWall2Basement.InsertString(0,"No basement present");
	m_comboWall2Basement.InsertString(1,"Unconnected to basement");
	m_comboWall2Basement.InsertString(2,"Directly above basement");
	m_comboWall2Basement.InsertString(3,"In heated basement");

	m_comboWall3Basement.InsertString(0,"No basement present");
	m_comboWall3Basement.InsertString(1,"Unconnected to basement");
	m_comboWall3Basement.InsertString(2,"Directly above basement");
	m_comboWall3Basement.InsertString(3,"In heated basement");

	m_comboWall4Basement.InsertString(0,"No basement present");
	m_comboWall4Basement.InsertString(1,"Unconnected to basement");
	m_comboWall4Basement.InsertString(2,"Directly above basement");
	m_comboWall4Basement.InsertString(3,"In heated basement");

	m_comboWall5Basement.InsertString(0,"No basement present");
	m_comboWall5Basement.InsertString(1,"Unconnected to basement");
	m_comboWall5Basement.InsertString(2,"Directly above basement");
	m_comboWall5Basement.InsertString(3,"In heated basement");

	m_comboWall6Basement.InsertString(0,"No basement present");
	m_comboWall6Basement.InsertString(1,"Unconnected to basement");
	m_comboWall6Basement.InsertString(2,"Directly above basement");
	m_comboWall6Basement.InsertString(3,"In heated basement");

	m_comboWall7Basement.InsertString(0,"No basement present");
	m_comboWall7Basement.InsertString(1,"Unconnected to basement");
	m_comboWall7Basement.InsertString(2,"Directly above basement");
	m_comboWall7Basement.InsertString(3,"In heated basement");

	m_comboWall8Basement.InsertString(0,"No basement present");
	m_comboWall8Basement.InsertString(1,"Unconnected to basement");
	m_comboWall8Basement.InsertString(2,"Directly above basement");
	m_comboWall8Basement.InsertString(3,"In heated basement");

	m_comboWall9Basement.InsertString(0,"No basement present");
	m_comboWall9Basement.InsertString(1,"Unconnected to basement");
	m_comboWall9Basement.InsertString(2,"Directly above basement");
	m_comboWall9Basement.InsertString(3,"In heated basement");

	m_comboWall10Basement.InsertString(0,"No basement present");
	m_comboWall10Basement.InsertString(1,"Unconnected to basement");
	m_comboWall10Basement.InsertString(2,"Directly above basement");
	m_comboWall10Basement.InsertString(3,"In heated basement");
}

void CDlg_Walls::ReadPreviousInputsFromWallsDlg()
{
	//------------------------------------------
	//	WALL NAME
	//------------------------------------------
	str_editWall1Name.Format("%s",wall1Name);
	str_editWall2Name.Format("%s",wall2Name);
	str_editWall3Name.Format("%s",wall3Name);
	str_editWall4Name.Format("%s",wall4Name);
	str_editWall5Name.Format("%s",wall5Name);
	str_editWall6Name.Format("%s",wall6Name);
	str_editWall7Name.Format("%s",wall7Name);
	str_editWall8Name.Format("%s",wall8Name);
	str_editWall9Name.Format("%s",wall9Name);
	str_editWall10Name.Format("%s",wall10Name);

	//------------------------------------------
	//	WALL CONSTRUCTION
	//------------------------------------------
	str_comboWall1Construction.Format("%s",wall1Construction);
	str_comboWall2Construction.Format("%s",wall2Construction);
	str_comboWall3Construction.Format("%s",wall3Construction);
	str_comboWall4Construction.Format("%s",wall4Construction);
	str_comboWall5Construction.Format("%s",wall5Construction);
	str_comboWall6Construction.Format("%s",wall6Construction);
	str_comboWall7Construction.Format("%s",wall7Construction);
	str_comboWall8Construction.Format("%s",wall8Construction);
	str_comboWall9Construction.Format("%s",wall9Construction);
	str_comboWall10Construction.Format("%s",wall10Construction);

	//------------------------------------------
	//	WALL BASEMENT
	//------------------------------------------
	str_comboWall1Basement.Format("%s",wall1Basement);
	str_comboWall2Basement.Format("%s",wall2Basement);
	str_comboWall3Basement.Format("%s",wall3Basement);
	str_comboWall4Basement.Format("%s",wall4Basement);
	str_comboWall5Basement.Format("%s",wall5Basement);
	str_comboWall6Basement.Format("%s",wall6Basement);
	str_comboWall7Basement.Format("%s",wall7Basement);
	str_comboWall8Basement.Format("%s",wall8Basement);
	str_comboWall9Basement.Format("%s",wall9Basement);
	str_comboWall10Basement.Format("%s",wall10Basement);

	//------------------------------------------
	//	WALL AREA
	//------------------------------------------
	str_editWall1Area.Format("%.1f",wall1Area);
	str_editWall2Area.Format("%.1f",wall2Area);
	str_editWall3Area.Format("%.1f",wall3Area);
	str_editWall4Area.Format("%.1f",wall4Area);
	str_editWall5Area.Format("%.1f",wall5Area);
	str_editWall6Area.Format("%.1f",wall6Area);
	str_editWall7Area.Format("%.1f",wall7Area);
	str_editWall8Area.Format("%.1f",wall8Area);
	str_editWall9Area.Format("%.1f",wall9Area);
	str_editWall10Area.Format("%.1f",wall10Area);

	//------------------------------------------
	//	WALL U-VALUE
	//------------------------------------------
	str_editWall1Uvalue.Format("%.1f",wall1Uvalue);
	str_editWall2Uvalue.Format("%.1f",wall2Uvalue);
	str_editWall3Uvalue.Format("%.1f",wall3Uvalue);
	str_editWall4Uvalue.Format("%.1f",wall4Uvalue);
	str_editWall5Uvalue.Format("%.1f",wall5Uvalue);
	str_editWall6Uvalue.Format("%.1f",wall6Uvalue);
	str_editWall7Uvalue.Format("%.1f",wall7Uvalue);
	str_editWall8Uvalue.Format("%.1f",wall8Uvalue);
	str_editWall9Uvalue.Format("%.1f",wall9Uvalue);
	str_editWall10Uvalue.Format("%.1f",wall10Uvalue);

	CheckWallNameStrings();
	UpdateData(FALSE);	
}

void CDlg_Walls::ReadInputsFromWallsDlg()
{
	UpdateData(TRUE);

	//------------------------------------------
	//	WALL NAME
	//------------------------------------------
	wall1Name = str_editWall1Name;
	wall2Name = str_editWall2Name;
	wall3Name = str_editWall3Name;
	wall4Name = str_editWall4Name;
	wall5Name = str_editWall5Name;
	wall6Name = str_editWall6Name;
	wall7Name = str_editWall7Name;
	wall8Name = str_editWall8Name;
	wall9Name = str_editWall9Name;
	wall10Name = str_editWall10Name;

	//------------------------------------------
	//	WALL CONSTRUCTION
	//------------------------------------------
	wall1Construction = str_comboWall1Construction;
	wall2Construction = str_comboWall2Construction;
	wall3Construction = str_comboWall3Construction;
	wall4Construction = str_comboWall4Construction;
	wall5Construction = str_comboWall5Construction;
	wall6Construction = str_comboWall6Construction;
	wall7Construction = str_comboWall7Construction;
	wall8Construction = str_comboWall8Construction;
	wall9Construction = str_comboWall9Construction;
	wall10Construction = str_comboWall10Construction;

	//------------------------------------------
	//	WALL BASEMENT
	//------------------------------------------
	wall1Basement = str_comboWall1Basement;
	wall2Basement = str_comboWall2Basement;
	wall3Basement = str_comboWall3Basement;
	wall4Basement = str_comboWall4Basement;
	wall5Basement = str_comboWall5Basement;
	wall6Basement = str_comboWall6Basement;
	wall7Basement = str_comboWall7Basement;
	wall8Basement = str_comboWall8Basement;
	wall9Basement = str_comboWall9Basement;
	wall10Basement = str_comboWall10Basement;

	//------------------------------------------
	//	WALL AREA
	//------------------------------------------
	wall1Area = atof(str_editWall1Area);
	wall2Area = atof(str_editWall2Area);
	wall3Area = atof(str_editWall3Area);
	wall4Area = atof(str_editWall4Area);
	wall5Area = atof(str_editWall5Area);
	wall6Area = atof(str_editWall6Area);
	wall7Area = atof(str_editWall7Area);
	wall8Area = atof(str_editWall8Area);
	wall9Area = atof(str_editWall9Area);
	wall10Area = atof(str_editWall10Area);

	//------------------------------------------
	//	WALL U-VALUE
	//------------------------------------------
	wall1Uvalue = atof(str_editWall1Uvalue);
	wall2Uvalue = atof(str_editWall2Uvalue);
	wall3Uvalue = atof(str_editWall3Uvalue);
	wall4Uvalue = atof(str_editWall4Uvalue);
	wall5Uvalue = atof(str_editWall5Uvalue);
	wall6Uvalue = atof(str_editWall6Uvalue);
	wall7Uvalue = atof(str_editWall7Uvalue);
	wall8Uvalue = atof(str_editWall8Uvalue);
	wall9Uvalue = atof(str_editWall9Uvalue);
	wall10Uvalue = atof(str_editWall10Uvalue);

	CheckWallNameStrings();
}


void CDlg_Walls::OnBnClickedCheck1()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedCheck3()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedCheck5()
{
	ReadInputsFromWallsDlg();
}
void CDlg_Walls::OnBnClickedCheck13()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedCheck8()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedCheck9()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedCheck15()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedCheck16()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedCheck17()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedCheck19()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit12()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall1Name, lpszValidChars) != 0) 
	{
		str_editWall1Name = " ";
		m_comboWall1Construction.EnableWindow(FALSE);
		m_comboWall1Basement.EnableWindow(FALSE);
		m_editWall1Area.EnableWindow(FALSE);
		m_editWall1Uvalue.EnableWindow(FALSE);
		m_openingWall1.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit15()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall2Name, lpszValidChars) != 0) 
	{
		str_editWall2Name = " ";
		m_comboWall2Construction.EnableWindow(FALSE);
		m_comboWall2Basement.EnableWindow(FALSE);
		m_editWall2Area.EnableWindow(FALSE);
		m_editWall2Uvalue.EnableWindow(FALSE);
		m_openingWall2.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit18()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall3Name, lpszValidChars) != 0) 
	{
		str_editWall3Name = " ";
		m_comboWall3Construction.EnableWindow(FALSE);
		m_comboWall3Basement.EnableWindow(FALSE);
		m_editWall3Area.EnableWindow(FALSE);
		m_editWall3Uvalue.EnableWindow(FALSE);
		m_openingWall3.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit21()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall4Name, lpszValidChars) != 0) 
	{
		str_editWall4Name = " ";
		m_comboWall4Construction.EnableWindow(FALSE);
		m_comboWall4Basement.EnableWindow(FALSE);
		m_editWall4Area.EnableWindow(FALSE);
		m_editWall4Uvalue.EnableWindow(FALSE);
		m_openingWall4.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit25()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall5Name, lpszValidChars) != 0) 
	{
		str_editWall5Name = " ";
		m_comboWall5Construction.EnableWindow(FALSE);
		m_comboWall5Basement.EnableWindow(FALSE);
		m_editWall5Area.EnableWindow(FALSE);
		m_editWall5Uvalue.EnableWindow(FALSE);
		m_openingWall5.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit28()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall6Name, lpszValidChars) != 0) 
	{
		str_editWall6Name = " ";
		m_comboWall6Construction.EnableWindow(FALSE);
		m_comboWall6Basement.EnableWindow(FALSE);
		m_editWall6Area.EnableWindow(FALSE);
		m_editWall6Uvalue.EnableWindow(FALSE);
		m_openingWall6.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit31()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall7Name, lpszValidChars) != 0) 
	{
		str_editWall7Name = " ";
		m_comboWall7Construction.EnableWindow(FALSE);
		m_comboWall7Basement.EnableWindow(FALSE);
		m_editWall7Area.EnableWindow(FALSE);
		m_editWall7Uvalue.EnableWindow(FALSE);
		m_openingWall7.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit34()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall8Name, lpszValidChars) != 0) 
	{
		str_editWall8Name = " ";
		m_comboWall8Construction.EnableWindow(FALSE);
		m_comboWall8Basement.EnableWindow(FALSE);
		m_editWall8Area.EnableWindow(FALSE);
		m_editWall8Uvalue.EnableWindow(FALSE);
		m_openingWall8.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit37()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall9Name, lpszValidChars) != 0) 
	{
		str_editWall9Name = " ";
		m_comboWall9Construction.EnableWindow(FALSE);
		m_comboWall9Basement.EnableWindow(FALSE);
		m_editWall9Area.EnableWindow(FALSE);
		m_editWall9Uvalue.EnableWindow(FALSE);
		m_openingWall9.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnEnChangeEdit40()
{
	//------------------------------------------------------------------------------
	// Empty edit box if user types any character other than numeric characters or '.'
	UpdateData(TRUE);
	static TCHAR * lpszValidChars = _T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -_");
	
	// szText is the string we want to check for invalid chracters
	if (_tcsspnp(str_editWall10Name, lpszValidChars) != 0) 
	{
		str_editWall10Name = " ";
		m_comboWall10Construction.EnableWindow(FALSE);
		m_comboWall10Basement.EnableWindow(FALSE);
		m_editWall10Area.EnableWindow(FALSE);
		m_editWall10Uvalue.EnableWindow(FALSE);
		m_openingWall10.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckWallNameStrings();
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo1()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo4()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo12()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo14()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo16()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo18()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo20()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo22()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo24()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo26()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo3()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo11()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo13()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo15()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo17()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo19()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo21()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo23()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo25()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnCbnSelchangeCombo27()
{
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall1Area, lpszValidChars) != 0) 
	{
		str_editWall1Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall2Area, lpszValidChars) != 0) 
	{
		str_editWall2Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall3Area, lpszValidChars) != 0) 
	{
		str_editWall3Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall4Area, lpszValidChars) != 0) 
	{
		str_editWall4Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall5Area, lpszValidChars) != 0) 
	{
		str_editWall5Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall6Area, lpszValidChars) != 0) 
	{
		str_editWall6Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall7Area, lpszValidChars) != 0) 
	{
		str_editWall7Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall8Area, lpszValidChars) != 0) 
	{
		str_editWall8Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall9Area, lpszValidChars) != 0) 
	{
		str_editWall9Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall10Area, lpszValidChars) != 0) 
	{
		str_editWall10Area = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall1Uvalue, lpszValidChars) != 0) 
	{
		str_editWall1Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall2Uvalue, lpszValidChars) != 0) 
	{
		str_editWall2Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall3Uvalue, lpszValidChars) != 0) 
	{
		str_editWall3Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall4Uvalue, lpszValidChars) != 0) 
	{
		str_editWall4Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall5Uvalue, lpszValidChars) != 0) 
	{
		str_editWall5Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall6Uvalue, lpszValidChars) != 0) 
	{
		str_editWall6Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall7Uvalue, lpszValidChars) != 0) 
	{
		str_editWall7Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall8Uvalue, lpszValidChars) != 0) 
	{
		str_editWall8Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall9Uvalue, lpszValidChars) != 0) 
	{
		str_editWall9Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::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_editWall10Uvalue, lpszValidChars) != 0) 
	{
		str_editWall10Uvalue = "";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromWallsDlg();
}

void CDlg_Walls::OnBnClickedButton3()
{
	WallRoofOpeningName = wall1Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Walls::OnBnClickedButton4()
{
	WallRoofOpeningName = wall2Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Walls::OnBnClickedButton5()
{
	WallRoofOpeningName = wall3Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Walls::OnBnClickedButton6()
{
	WallRoofOpeningName = wall4Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Walls::OnBnClickedButton7()
{
	WallRoofOpeningName = wall5Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Walls::OnBnClickedButton8()
{
	WallRoofOpeningName = wall6Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Walls::OnBnClickedButton9()
{
	WallRoofOpeningName = wall7Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
	// TODO: Add your control notification handler code here
}

void CDlg_Walls::OnBnClickedButton10()
{
	WallRoofOpeningName = wall8Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Walls::OnBnClickedButton11()
{
	WallRoofOpeningName = wall9Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Walls::OnBnClickedButton12()
{
	WallRoofOpeningName = wall10Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

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