// Dlg_Roofs.cpp : implementation file
//

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


// CDlg_Roofs dialog

IMPLEMENT_DYNAMIC(CDlg_Roofs, CDialog)
CDlg_Roofs::CDlg_Roofs(CWnd* pParent /*=NULL*/)
	: CDialog(CDlg_Roofs::IDD, pParent)
	, str_editRoof1Name(_T(""))
	, str_editRoof2Name(_T(""))
	, str_editRoof3Name(_T(""))
	, str_editRoof4Name(_T(""))
	, str_editRoof5Name(_T(""))
	, str_editRoof6Name(_T(""))
	, str_editRoof7Name(_T(""))
	, str_editRoof8Name(_T(""))
	, str_editRoof9Name(_T(""))
	, str_editRoof10Name(_T(""))
	, str_comboRoof1Construction(_T(""))
	, str_comboRoof2Construction(_T(""))
	, str_comboRoof3Construction(_T(""))
	, str_comboRoof4Construction(_T(""))
	, str_comboRoof5Construction(_T(""))
	, str_comboRoof6Construction(_T(""))
	, str_comboRoof7Construction(_T(""))
	, str_comboRoof8Construction(_T(""))
	, str_comboRoof9Construction(_T(""))
	, str_comboRoof10Construction(_T(""))
	, str_editRoof1Area(_T(""))
	, str_editRoof2Area(_T(""))
	, str_editRoof3Area(_T(""))
	, str_editRoof4Area(_T(""))
	, str_editRoof5Area(_T(""))
	, str_editRoof6Area(_T(""))
	, str_editRoof7Area(_T(""))
	, str_editRoof8Area(_T(""))
	, str_editRoof9Area(_T(""))
	, str_editRoof10Area(_T(""))
	, str_Roof1Uvalue(_T(""))
	, str_Roof2Uvalue(_T(""))
	, str_Roof3Uvalue(_T(""))
	, str_Roof4Uvalue(_T(""))
	, str_Roof5Uvalue(_T(""))
	, str_Roof6Uvalue(_T(""))
	, str_Roof7Uvalue(_T(""))
	, str_Roof8Uvalue(_T(""))
	, str_Roof9Uvalue(_T(""))
	, str_Roof10Uvalue(_T(""))
{
}

CDlg_Roofs::~CDlg_Roofs()
{
}

void CDlg_Roofs::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_CHECK1, m_btnRoof1);
	DDX_Control(pDX, IDC_CHECK3, m_btnRoof2);
	DDX_Control(pDX, IDC_CHECK5, m_btnRoof3);
	DDX_Control(pDX, IDC_CHECK13, m_btnRoof4);
	DDX_Control(pDX, IDC_CHECK8, m_btnRoof5);
	DDX_Control(pDX, IDC_CHECK9, m_btnRoof6);
	DDX_Control(pDX, IDC_CHECK15, m_btnRoof7);
	DDX_Control(pDX, IDC_CHECK16, m_btnRoof8);
	DDX_Control(pDX, IDC_CHECK17, m_btnRoof9);
	DDX_Control(pDX, IDC_CHECK19, m_btnRoof10);
	DDX_Control(pDX, IDC_EDIT12, m_editRoof1Name);
	DDX_Control(pDX, IDC_EDIT15, m_editRoof2Name);
	DDX_Control(pDX, IDC_EDIT18, m_editRoof3Name);
	DDX_Control(pDX, IDC_EDIT21, m_editRoof4Name);
	DDX_Control(pDX, IDC_EDIT25, m_editRoof5Name);
	DDX_Control(pDX, IDC_EDIT28, m_editRoof6Name);
	DDX_Control(pDX, IDC_EDIT31, m_editRoof7Name);
	DDX_Control(pDX, IDC_EDIT34, m_editRoof8Name);
	DDX_Control(pDX, IDC_EDIT37, m_editRoof9Name);
	DDX_Control(pDX, IDC_EDIT40, m_editRoof10Name);
	DDX_Control(pDX, IDC_COMBO1, m_comboRoof1Construction);
	DDX_Control(pDX, IDC_COMBO4, m_comboRoof2Construction);
	DDX_Control(pDX, IDC_COMBO12, m_comboRoof3Construction);
	DDX_Control(pDX, IDC_COMBO14, m_comboRoof4Construction);
	DDX_Control(pDX, IDC_COMBO16, m_comboRoof5Construction);
	DDX_Control(pDX, IDC_COMBO18, m_comboRoof6Construction);
	DDX_Control(pDX, IDC_COMBO20, m_comboRoof7Construction);
	DDX_Control(pDX, IDC_COMBO22, m_comboRoof8Construction);
	DDX_Control(pDX, IDC_COMBO24, m_comboRoof9Construction);
	DDX_Control(pDX, IDC_COMBO26, m_comboRoof10Construction);
	DDX_Control(pDX, IDC_EDIT13, m_editRoof1Area);
	DDX_Control(pDX, IDC_EDIT16, m_editRoof2Area);
	DDX_Control(pDX, IDC_EDIT19, m_editRoof3Area);
	DDX_Control(pDX, IDC_EDIT22, m_editRoof4Area);
	DDX_Control(pDX, IDC_EDIT26, m_editRoof5Area);
	DDX_Control(pDX, IDC_EDIT29, m_editRoof6Area);
	DDX_Control(pDX, IDC_EDIT32, m_editRoof7Area);
	DDX_Control(pDX, IDC_EDIT35, m_editRoof8Area);
	DDX_Control(pDX, IDC_EDIT38, m_editRoof9Area);
	DDX_Control(pDX, IDC_EDIT41, m_editRoof10Area);
	DDX_Control(pDX, IDC_EDIT14, m_Roof1Uvalue);
	DDX_Control(pDX, IDC_EDIT17, m_Roof2Uvalue);
	DDX_Control(pDX, IDC_EDIT20, m_Roof3Uvalue);
	DDX_Control(pDX, IDC_EDIT23, m_Roof4Uvalue);
	DDX_Control(pDX, IDC_EDIT27, m_Roof5Uvalue);
	DDX_Control(pDX, IDC_EDIT30, m_Roof6Uvalue);
	DDX_Control(pDX, IDC_EDIT33, m_Roof7Uvalue);
	DDX_Control(pDX, IDC_EDIT36, m_Roof8Uvalue);
	DDX_Control(pDX, IDC_EDIT39, m_Roof9Uvalue);
	DDX_Control(pDX, IDC_EDIT42, m_Roof10Uvalue);
	DDX_Text(pDX, IDC_EDIT12, str_editRoof1Name);
	DDX_Text(pDX, IDC_EDIT15, str_editRoof2Name);
	DDX_Text(pDX, IDC_EDIT18, str_editRoof3Name);
	DDX_Text(pDX, IDC_EDIT21, str_editRoof4Name);
	DDX_Text(pDX, IDC_EDIT25, str_editRoof5Name);
	DDX_Text(pDX, IDC_EDIT28, str_editRoof6Name);
	DDX_Text(pDX, IDC_EDIT31, str_editRoof7Name);
	DDX_Text(pDX, IDC_EDIT34, str_editRoof8Name);
	DDX_Text(pDX, IDC_EDIT37, str_editRoof9Name);
	DDX_Text(pDX, IDC_EDIT40, str_editRoof10Name);
	DDX_CBString(pDX, IDC_COMBO1, str_comboRoof1Construction);
	DDX_CBString(pDX, IDC_COMBO4, str_comboRoof2Construction);
	DDX_CBString(pDX, IDC_COMBO12, str_comboRoof3Construction);
	DDX_CBString(pDX, IDC_COMBO14, str_comboRoof4Construction);
	DDX_CBString(pDX, IDC_COMBO16, str_comboRoof5Construction);
	DDX_CBString(pDX, IDC_COMBO18, str_comboRoof6Construction);
	DDX_CBString(pDX, IDC_COMBO20, str_comboRoof7Construction);
	DDX_CBString(pDX, IDC_COMBO22, str_comboRoof8Construction);
	DDX_CBString(pDX, IDC_COMBO24, str_comboRoof9Construction);
	DDX_CBString(pDX, IDC_COMBO26, str_comboRoof10Construction);
	DDX_Text(pDX, IDC_EDIT13, str_editRoof1Area);
	DDX_Text(pDX, IDC_EDIT16, str_editRoof2Area);
	DDX_Text(pDX, IDC_EDIT19, str_editRoof3Area);
	DDX_Text(pDX, IDC_EDIT22, str_editRoof4Area);
	DDX_Text(pDX, IDC_EDIT26, str_editRoof5Area);
	DDX_Text(pDX, IDC_EDIT29, str_editRoof6Area);
	DDX_Text(pDX, IDC_EDIT32, str_editRoof7Area);
	DDX_Text(pDX, IDC_EDIT35, str_editRoof8Area);
	DDX_Text(pDX, IDC_EDIT38, str_editRoof9Area);
	DDX_Text(pDX, IDC_EDIT41, str_editRoof10Area);
	DDX_Text(pDX, IDC_EDIT14, str_Roof1Uvalue);
	DDX_Text(pDX, IDC_EDIT17, str_Roof2Uvalue);
	DDX_Text(pDX, IDC_EDIT20, str_Roof3Uvalue);
	DDX_Text(pDX, IDC_EDIT23, str_Roof4Uvalue);
	DDX_Text(pDX, IDC_EDIT27, str_Roof5Uvalue);
	DDX_Text(pDX, IDC_EDIT30, str_Roof6Uvalue);
	DDX_Text(pDX, IDC_EDIT33, str_Roof7Uvalue);
	DDX_Text(pDX, IDC_EDIT36, str_Roof8Uvalue);
	DDX_Text(pDX, IDC_EDIT39, str_Roof9Uvalue);
	DDX_Text(pDX, IDC_EDIT42, str_Roof10Uvalue);
	DDX_Control(pDX, IDC_STATIC_1, m_label1);
	DDX_Control(pDX, IDC_BUTTON_ROOF1, m_openingRoof1);
	DDX_Control(pDX, IDC_BUTTON_ROOF2, m_openingRoof2);
	DDX_Control(pDX, IDC_BUTTON_ROOF3, m_openingRoof3);
	DDX_Control(pDX, IDC_BUTTON_ROOF4, m_openingRoof4);
	DDX_Control(pDX, IDC_BUTTON_ROOF5, m_openingRoof5);
	DDX_Control(pDX, IDC_BUTTON_ROOF6, m_openingRoof6);
	DDX_Control(pDX, IDC_BUTTON_ROOF7, m_openingRoof7);
	DDX_Control(pDX, IDC_BUTTON_ROOF8, m_openingRoof8);
	DDX_Control(pDX, IDC_BUTTON_ROOF9, m_openingRoof9);
	DDX_Control(pDX, IDC_BUTTON_ROOF10, m_openingRoof10);
}


BEGIN_MESSAGE_MAP(CDlg_Roofs, CDialog)
	ON_BN_CLICKED(IDC_BUTTON6, OnBnClickedButton6)
	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_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_BUTTON_ROOF1, OnBnClickedButtonRoof1)
	ON_BN_CLICKED(IDC_BUTTON_ROOF2, OnBnClickedButtonRoof2)
	ON_BN_CLICKED(IDC_BUTTON_ROOF3, OnBnClickedButtonRoof3)
	ON_BN_CLICKED(IDC_BUTTON_ROOF4, OnBnClickedButtonRoof4)
	ON_BN_CLICKED(IDC_BUTTON_ROOF5, OnBnClickedButtonRoof5)
	ON_BN_CLICKED(IDC_BUTTON_ROOF6, OnBnClickedButtonRoof6)
	ON_BN_CLICKED(IDC_BUTTON_ROOF7, OnBnClickedButtonRoof7)
	ON_BN_CLICKED(IDC_BUTTON_ROOF9, OnBnClickedButtonRoof9)
	ON_BN_CLICKED(IDC_BUTTON_ROOF8, OnBnClickedButtonRoof8)
	ON_BN_CLICKED(IDC_BUTTON_ROOF10, OnBnClickedButtonRoof10)
END_MESSAGE_MAP()


// CDlg_Roofs message handlers
BOOL CDlg_Roofs::OnInitDialog()
{
	CDialog::OnInitDialog();
	
	CFont *m_Font1 = new CFont;
	m_Font1->CreatePointFont(90, "Arial Bold");

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

	AddStringsForRoofDlg();

	if(file_new_selected ==true)
	{
		//------------------------------------------
		//	ROOF NAME
		//------------------------------------------
		roof1Name = " "; 
		roof2Name = " "; 
		roof3Name = " "; 
		roof4Name = " ";  
		roof5Name = " "; 
		roof6Name = " "; 
		roof7Name = " "; 
		roof8Name = " "; 
		roof9Name = " "; 
		roof10Name = " "; 

		//------------------------------------------
		//	ROOF CONSTRUCTION
		//------------------------------------------
		roof1Construction = " "; 
		roof2Construction = " "; 
		roof3Construction = " "; 
		roof4Construction = " "; 
		roof5Construction = " "; 
		roof6Construction = " "; 
		roof7Construction = " "; 
		roof8Construction = " "; 
		roof9Construction = " "; 
		roof10Construction = " "; 

		//------------------------------------------
		//	ROOF AREA
		//------------------------------------------
		roof1Area = 0;
		roof2Area = 0;
		roof3Area = 0;
		roof4Area = 0;
		roof5Area = 0;
		roof6Area = 0;
		roof7Area = 0;
		roof8Area = 0;
		roof9Area = 0;
		roof10Area= 0;

		//------------------------------------------
		//	ROOF U-VALUE
		//------------------------------------------
		roof1Uvalue = 0;
		roof2Uvalue = 0;
		roof3Uvalue = 0;
		roof4Uvalue = 0;
		roof5Uvalue = 0;
		roof6Uvalue = 0;
		roof7Uvalue = 0;
		roof8Uvalue = 0;
		roof9Uvalue = 0;
		roof10Uvalue= 0;

	}

	CheckRoofNameStrings();
	ReadPreviousInputsFromRoofDlg();

	return TRUE;
}

void CDlg_Roofs::CheckRoofNameStrings()
{
	//-------
	// ROOF1
	//-------
	if(roof1Name.IsEmpty())
	{
		m_comboRoof1Construction.EnableWindow(FALSE);
		m_editRoof1Area.EnableWindow(FALSE);
		m_Roof1Uvalue.EnableWindow(FALSE);
		m_openingRoof1.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof1Construction.EnableWindow(TRUE);
		m_editRoof1Area.EnableWindow(TRUE);
		m_Roof1Uvalue.EnableWindow(TRUE);
		m_openingRoof1.EnableWindow(TRUE);
	}

	//-------
	// ROOF2
	//-------
	if(roof2Name.IsEmpty())
	{
		m_comboRoof2Construction.EnableWindow(FALSE);
		m_editRoof2Area.EnableWindow(FALSE);
		m_Roof2Uvalue.EnableWindow(FALSE);
		m_openingRoof2.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof2Construction.EnableWindow(TRUE);
		m_editRoof2Area.EnableWindow(TRUE);
		m_Roof2Uvalue.EnableWindow(TRUE);
		m_openingRoof2.EnableWindow(TRUE);
	}

	//-------
	// ROOF3
	//-------
	if(roof3Name.IsEmpty())
	{
		m_comboRoof3Construction.EnableWindow(FALSE);
		m_editRoof3Area.EnableWindow(FALSE);
		m_Roof3Uvalue.EnableWindow(FALSE);
		m_openingRoof3.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof3Construction.EnableWindow(TRUE);
		m_editRoof3Area.EnableWindow(TRUE);
		m_Roof3Uvalue.EnableWindow(TRUE);
		m_openingRoof3.EnableWindow(TRUE);
	}

	//-------
	// ROOF4
	//-------
	if(roof4Name.IsEmpty())
	{
		m_comboRoof4Construction.EnableWindow(FALSE);
		m_editRoof4Area.EnableWindow(FALSE);
		m_Roof4Uvalue.EnableWindow(FALSE);
		m_openingRoof4.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof4Construction.EnableWindow(TRUE);
		m_editRoof4Area.EnableWindow(TRUE);
		m_Roof4Uvalue.EnableWindow(TRUE);
		m_openingRoof4.EnableWindow(TRUE);
	}

	//-------
	// ROOF5
	//-------
	if(roof5Name.IsEmpty())
	{
		m_comboRoof5Construction.EnableWindow(FALSE);
		m_editRoof5Area.EnableWindow(FALSE);
		m_Roof5Uvalue.EnableWindow(FALSE);
		m_openingRoof5.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof5Construction.EnableWindow(TRUE);
		m_editRoof5Area.EnableWindow(TRUE);
		m_Roof5Uvalue.EnableWindow(TRUE);
		m_openingRoof5.EnableWindow(TRUE);
	}

	//-------
	// ROOF6
	//-------
	if(roof6Name.IsEmpty())
	{
		m_comboRoof6Construction.EnableWindow(FALSE);
		m_editRoof6Area.EnableWindow(FALSE);
		m_Roof6Uvalue.EnableWindow(FALSE);
		m_openingRoof6.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof6Construction.EnableWindow(TRUE);
		m_editRoof6Area.EnableWindow(TRUE);
		m_Roof6Uvalue.EnableWindow(TRUE);
		m_openingRoof6.EnableWindow(TRUE);
	}

	//-------
	// ROOF7
	//-------
	if(roof7Name.IsEmpty())
	{
		m_comboRoof7Construction.EnableWindow(FALSE);
		m_editRoof7Area.EnableWindow(FALSE);
		m_Roof7Uvalue.EnableWindow(FALSE);
		m_openingRoof7.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof7Construction.EnableWindow(TRUE);
		m_editRoof7Area.EnableWindow(TRUE);
		m_Roof7Uvalue.EnableWindow(TRUE);
		m_openingRoof7.EnableWindow(TRUE);
	}

	//-------
	// ROOF8
	//-------
	if(roof8Name.IsEmpty())
	{
		m_comboRoof8Construction.EnableWindow(FALSE);
		m_editRoof8Area.EnableWindow(FALSE);
		m_Roof8Uvalue.EnableWindow(FALSE);
		m_openingRoof8.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof8Construction.EnableWindow(TRUE);
		m_editRoof8Area.EnableWindow(TRUE);
		m_Roof8Uvalue.EnableWindow(TRUE);
		m_openingRoof8.EnableWindow(TRUE);
	}

	//-------
	// ROOF9
	//-------
	if(roof9Name.IsEmpty())
	{
		m_comboRoof9Construction.EnableWindow(FALSE);
		m_editRoof9Area.EnableWindow(FALSE);
		m_Roof9Uvalue.EnableWindow(FALSE);
		m_openingRoof9.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof9Construction.EnableWindow(TRUE);
		m_editRoof9Area.EnableWindow(TRUE);
		m_Roof9Uvalue.EnableWindow(TRUE);
		m_openingRoof9.EnableWindow(TRUE);
	}

	//-------
	// ROOF10
	//-------
	if(roof10Name.IsEmpty())
	{
		m_comboRoof10Construction.EnableWindow(FALSE);
		m_editRoof10Area.EnableWindow(FALSE);
		m_Roof10Uvalue.EnableWindow(FALSE);
		m_openingRoof10.EnableWindow(FALSE);
	}
	else
	{
		m_comboRoof10Construction.EnableWindow(TRUE);
		m_editRoof10Area.EnableWindow(TRUE);
		m_Roof10Uvalue.EnableWindow(TRUE);
		m_openingRoof10.EnableWindow(TRUE);
	}


}

void CDlg_Roofs::AddStringsForRoofDlg()
{
	m_comboRoof1Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof1Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof1Construction.InsertString(2,"Flat");

	m_comboRoof2Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof2Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof2Construction.InsertString(2,"Flat");

	m_comboRoof3Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof3Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof3Construction.InsertString(2,"Flat");

	m_comboRoof4Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof4Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof4Construction.InsertString(2,"Flat");

	m_comboRoof5Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof5Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof5Construction.InsertString(2,"Flat");

	m_comboRoof6Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof6Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof6Construction.InsertString(2,"Flat");

	m_comboRoof7Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof7Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof7Construction.InsertString(2,"Flat");

	m_comboRoof8Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof8Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof8Construction.InsertString(2,"Flat");

	m_comboRoof9Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof9Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof9Construction.InsertString(2,"Flat");

	m_comboRoof10Construction.InsertString(0,"Pitched (rafters)");
	m_comboRoof10Construction.InsertString(1,"Pitched (joist)");
	m_comboRoof10Construction.InsertString(2,"Flat");
}

void CDlg_Roofs::ReadPreviousInputsFromRoofDlg()
{
	//------------------------------------------
	//	ROOF NAME
	//------------------------------------------
	str_editRoof1Name.Format("%s",roof1Name);
	str_editRoof2Name.Format("%s",roof2Name);
	str_editRoof3Name.Format("%s",roof3Name);
	str_editRoof4Name.Format("%s",roof4Name);
	str_editRoof5Name.Format("%s",roof5Name);
	str_editRoof6Name.Format("%s",roof6Name);
	str_editRoof7Name.Format("%s",roof7Name);
	str_editRoof8Name.Format("%s",roof8Name);
	str_editRoof9Name.Format("%s",roof9Name);
	str_editRoof10Name.Format("%s",roof10Name);

	//------------------------------------------
	//	ROOF CONSTRUCTION
	//------------------------------------------
	str_comboRoof1Construction.Format("%s",roof1Construction);
	str_comboRoof2Construction.Format("%s",roof2Construction);
	str_comboRoof3Construction.Format("%s",roof3Construction);
	str_comboRoof4Construction.Format("%s",roof4Construction);
	str_comboRoof5Construction.Format("%s",roof5Construction);
	str_comboRoof6Construction.Format("%s",roof6Construction);
	str_comboRoof7Construction.Format("%s",roof7Construction);
	str_comboRoof8Construction.Format("%s",roof8Construction);
	str_comboRoof9Construction.Format("%s",roof9Construction);
	str_comboRoof10Construction.Format("%s",roof10Construction);

	//------------------------------------------
	//	ROOF AREA
	//------------------------------------------
	str_editRoof1Area.Format("%.1f",roof1Area);
	str_editRoof2Area.Format("%.1f",roof2Area);
	str_editRoof3Area.Format("%.1f",roof3Area);
	str_editRoof4Area.Format("%.1f",roof4Area);
	str_editRoof5Area.Format("%.1f",roof5Area);
	str_editRoof6Area.Format("%.1f",roof6Area);
	str_editRoof7Area.Format("%.1f",roof7Area);
	str_editRoof8Area.Format("%.1f",roof8Area);
	str_editRoof9Area.Format("%.1f",roof9Area);
	str_editRoof10Area.Format("%.1f",roof10Area);

	//------------------------------------------
	//	ROOF U-VALUE
	//------------------------------------------
	str_Roof1Uvalue.Format("%.1f",roof1Uvalue);
	str_Roof2Uvalue.Format("%.1f",roof2Uvalue);
	str_Roof3Uvalue.Format("%.1f",roof3Uvalue);
	str_Roof4Uvalue.Format("%.1f",roof4Uvalue);
	str_Roof5Uvalue.Format("%.1f",roof5Uvalue);
	str_Roof6Uvalue.Format("%.1f",roof6Uvalue);
	str_Roof7Uvalue.Format("%.1f",roof7Uvalue);
	str_Roof8Uvalue.Format("%.1f",roof8Uvalue);
	str_Roof9Uvalue.Format("%.1f",roof9Uvalue);
	str_Roof10Uvalue.Format("%.1f",roof10Uvalue);

	CheckRoofNameStrings();

	UpdateData(FALSE);
}

void CDlg_Roofs::ReadInputsFromRoofDlg()
{
	UpdateData(TRUE);

	//------------------------------------------
	//	ROOF NAME
	//------------------------------------------
	roof1Name = str_editRoof1Name;
	roof2Name = str_editRoof2Name;
	roof3Name = str_editRoof3Name;
	roof4Name = str_editRoof4Name;
	roof5Name = str_editRoof5Name;
	roof6Name = str_editRoof6Name;
	roof7Name = str_editRoof7Name;
	roof8Name = str_editRoof8Name;
	roof9Name = str_editRoof9Name;
	roof10Name= str_editRoof10Name;

	//------------------------------------------
	//	ROOF CONSTRUCTION
	//------------------------------------------
	roof1Construction = str_comboRoof1Construction;
	roof2Construction = str_comboRoof2Construction;
	roof3Construction = str_comboRoof3Construction;
	roof4Construction = str_comboRoof4Construction;
	roof5Construction = str_comboRoof5Construction;
	roof6Construction = str_comboRoof6Construction;
	roof7Construction = str_comboRoof7Construction;
	roof8Construction = str_comboRoof8Construction;
	roof9Construction = str_comboRoof9Construction;
	roof10Construction= str_comboRoof10Construction;

	//------------------------------------------
	//	ROOF AREA
	//------------------------------------------
	roof1Area = atof(str_editRoof1Area);
	roof2Area = atof(str_editRoof2Area);
	roof3Area = atof(str_editRoof3Area);
	roof4Area = atof(str_editRoof4Area);
	roof5Area = atof(str_editRoof5Area);
	roof6Area = atof(str_editRoof6Area);
	roof7Area = atof(str_editRoof7Area);
	roof8Area = atof(str_editRoof8Area);
	roof9Area = atof(str_editRoof9Area);
	roof10Area= atof(str_editRoof10Area);

	//------------------------------------------
	//	ROOF U-VALUE
	//------------------------------------------
	roof1Uvalue = atof(str_Roof1Uvalue);
	roof2Uvalue = atof(str_Roof2Uvalue);
	roof3Uvalue = atof(str_Roof3Uvalue);
	roof4Uvalue = atof(str_Roof4Uvalue);
	roof5Uvalue = atof(str_Roof5Uvalue);
	roof6Uvalue = atof(str_Roof6Uvalue);
	roof7Uvalue = atof(str_Roof7Uvalue);
	roof8Uvalue = atof(str_Roof8Uvalue);
	roof9Uvalue = atof(str_Roof9Uvalue);
	roof10Uvalue= atof(str_Roof10Uvalue);
	CheckRoofNameStrings();
}


void CDlg_Roofs::OnBnClickedButton6()
{
	// TODO: Add your control notification handler code here
}

void CDlg_Roofs::OnBnClickedCheck1()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck3()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck5()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck13()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck8()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck9()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck15()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck16()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck17()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedCheck19()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnEnChangeEdit12()
{
	//------------------------------------------------------------------------------
	// 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_editRoof1Name, lpszValidChars) != 0) 
	{
		str_editRoof1Name = " "; 
		m_comboRoof1Construction.EnableWindow(FALSE);
		m_editRoof1Area.EnableWindow(FALSE);
		m_Roof1Uvalue.EnableWindow(FALSE);
		m_openingRoof1.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof2Name, lpszValidChars) != 0) 
	{
		str_editRoof2Name = " "; 
		m_comboRoof2Construction.EnableWindow(FALSE);
		m_editRoof2Area.EnableWindow(FALSE);
		m_Roof2Uvalue.EnableWindow(FALSE);
		m_openingRoof2.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof3Name, lpszValidChars) != 0) 
	{
		str_editRoof3Name = " "; 
		m_comboRoof3Construction.EnableWindow(FALSE);
		m_editRoof3Area.EnableWindow(FALSE);
		m_Roof3Uvalue.EnableWindow(FALSE);
		m_openingRoof3.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof4Name, lpszValidChars) != 0) 
	{
		str_editRoof4Name = " ";
		m_comboRoof4Construction.EnableWindow(FALSE);
		m_editRoof4Area.EnableWindow(FALSE);
		m_Roof4Uvalue.EnableWindow(FALSE);
		m_openingRoof4.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof5Name, lpszValidChars) != 0) 
	{
		str_editRoof5Name = " "; 
		m_comboRoof5Construction.EnableWindow(FALSE);
		m_editRoof5Area.EnableWindow(FALSE);
		m_Roof5Uvalue.EnableWindow(FALSE);
		m_openingRoof5.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof6Name, lpszValidChars) != 0) 
	{
		str_editRoof6Name = " "; 
		m_comboRoof6Construction.EnableWindow(FALSE);
		m_editRoof6Area.EnableWindow(FALSE);
		m_Roof6Uvalue.EnableWindow(FALSE);
		m_openingRoof6.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof7Name, lpszValidChars) != 0) 
	{
		str_editRoof7Name = " "; 
		m_comboRoof7Construction.EnableWindow(FALSE);
		m_editRoof7Area.EnableWindow(FALSE);
		m_Roof7Uvalue.EnableWindow(FALSE);
		m_openingRoof7.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof8Name, lpszValidChars) != 0) 
	{
		str_editRoof8Name = " "; 
		m_comboRoof8Construction.EnableWindow(FALSE);
		m_editRoof8Area.EnableWindow(FALSE);
		m_Roof8Uvalue.EnableWindow(FALSE);
		m_openingRoof8.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof9Name, lpszValidChars) != 0) 
	{
		str_editRoof9Name = " "; 
		m_comboRoof9Construction.EnableWindow(FALSE);
		m_editRoof9Area.EnableWindow(FALSE);
		m_Roof9Uvalue.EnableWindow(FALSE);
		m_openingRoof9.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof10Name, lpszValidChars) != 0) 
	{
		str_editRoof10Name = " ";
		m_comboRoof10Construction.EnableWindow(FALSE);
		m_editRoof10Area.EnableWindow(FALSE);
		m_Roof10Uvalue.EnableWindow(FALSE);
		m_openingRoof10.EnableWindow(FALSE);
		UpdateData(FALSE);
		return;
	}
	CheckRoofNameStrings();
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo1()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo4()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo12()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo14()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo16()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo18()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo20()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo22()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo24()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnCbnSelchangeCombo26()
{
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof1Area, lpszValidChars) != 0) 
	{
		str_editRoof1Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof2Area, lpszValidChars) != 0) 
	{
		str_editRoof2Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof3Area, lpszValidChars) != 0) 
	{
		str_editRoof3Area = " "; 
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof4Area, lpszValidChars) != 0) 
	{
		str_editRoof4Area = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof5Area, lpszValidChars) != 0) 
	{
		str_editRoof5Area = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof6Area, lpszValidChars) != 0) 
	{
		str_editRoof6Area = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof7Area, lpszValidChars) != 0) 
	{
		str_editRoof7Area = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof8Area, lpszValidChars) != 0) 
	{
		str_editRoof8Area = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof9Area, lpszValidChars) != 0) 
	{
		str_editRoof9Area = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_editRoof10Area, lpszValidChars) != 0) 
	{
		str_editRoof10Area = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof1Uvalue, lpszValidChars) != 0) 
	{
		str_Roof1Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof2Uvalue, lpszValidChars) != 0) 
	{
		str_Roof2Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof3Uvalue, lpszValidChars) != 0) 
	{
		str_Roof3Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof4Uvalue, lpszValidChars) != 0) 
	{
		str_Roof4Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof5Uvalue, lpszValidChars) != 0) 
	{
		str_Roof5Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof6Uvalue, lpszValidChars) != 0) 
	{
		str_Roof6Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof7Uvalue, lpszValidChars) != 0) 
	{
		str_Roof7Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof8Uvalue, lpszValidChars) != 0) 
	{
		str_Roof8Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof9Uvalue, lpszValidChars) != 0) 
	{
		str_Roof9Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::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_Roof10Uvalue, lpszValidChars) != 0) 
	{
		str_Roof10Uvalue = " ";
		UpdateData(FALSE);
		return;
	}
	ReadInputsFromRoofDlg();
}

void CDlg_Roofs::OnBnClickedButtonRoof1()
{
	WallRoofOpeningName = roof1Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Roofs::OnBnClickedButtonRoof2()
{
	WallRoofOpeningName = roof2Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Roofs::OnBnClickedButtonRoof3()
{
	WallRoofOpeningName = roof3Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Roofs::OnBnClickedButtonRoof4()
{
	WallRoofOpeningName = roof4Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Roofs::OnBnClickedButtonRoof5()
{
	WallRoofOpeningName = roof5Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Roofs::OnBnClickedButtonRoof6()
{
	WallRoofOpeningName = roof6Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Roofs::OnBnClickedButtonRoof7()
{
	WallRoofOpeningName = roof7Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Roofs::OnBnClickedButtonRoof8()
{
	WallRoofOpeningName = roof8Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

void CDlg_Roofs::OnBnClickedButtonRoof9()
{
	WallRoofOpeningName = roof9Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}



void CDlg_Roofs::OnBnClickedButtonRoof10()
{
	WallRoofOpeningName = roof10Name;
	CDlg_WindowRoofOpenings Dlg_WindowRoofOpenings;
	Dlg_WindowRoofOpenings.DoModal();
}

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