// Dlg_AreaAndUvalues.cpp : implementation file
//

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

CToolTipCtrl *m_ToolTipLAF;

// CDlg_AreaAndUvalues dialog
IMPLEMENT_DYNAMIC(CDlg_AreaAndUvalues, CDialog)
CDlg_AreaAndUvalues::CDlg_AreaAndUvalues(CWnd* pParent /*=NULL*/)
	: CDialog(CDlg_AreaAndUvalues::IDD, pParent)
	, str_editGrossAreaWall1(_T(""))
	, str_editGrossAreaRoof1(_T(""))
	, str_editNetAreaDoors(_T(""))
	, str_editNetAreaWindows(_T(""))
	, str_editNetAreaRoofLights(_T(""))
	, str_editNetAreaGF(_T(""))
	, str_editNetAreaExFloor(_T(""))
	, str_editNetAreaWallType1(_T(""))
	, str_editNetAreaWallType2(_T(""))
	, str_editNetAreaRoofType1(_T(""))
	, str_editNetAreaRoofType2(_T(""))
	, str_editNetAreaPartyWall(_T(""))
	, str_editNetAreaPartyFloor(_T(""))
	, str_editNetAreaPartyCeiling(_T(""))
	, str_editNetAreaInternalWall(_T(""))
	, str_editNetAreaInternalFloor(_T(""))
	, str_editNetAreaInternalCeiling(_T(""))
	, str_editUvalueDoors(_T(""))
	, str_editUvalueWindows(_T(""))
	, str_editUvalueRooflights(_T(""))
	, str_editUvalueGF(_T(""))
	, str_editUvalueExposedFloor(_T(""))
	, str_editUvalueWallType1(_T(""))
	, str_editUvalueWallType2(_T(""))
	, str_editUvalueRoofTYpe1(_T(""))
	, str_editUvalueRoofType2(_T(""))
	, str_editUvaluePartyWall(_T(""))
	, str_editkValueGF(_T(""))
	, str_editkValueExpFloor(_T(""))
	, str_editkValueWallType1(_T(""))
	, str_editkValueWallType2(_T(""))
	, str_editkValueRoofType1(_T(""))
	, str_editkValueRoofType2(_T(""))
	, str_editkValuePartyWall(_T(""))
	, str_editkValuePartyFloor(_T(""))
	, str_editkValuePartyCeiling(_T(""))
	, str_editkValueIntWall(_T(""))
	, str_editkValueIntFloor(_T(""))
	, str_editkValueIntCeiling(_T(""))
	, str_editThermalMass(_T(""))
	, str_editLivingRoomFraction(_T(""))
{
}

CDlg_AreaAndUvalues::~CDlg_AreaAndUvalues()
{
}

void CDlg_AreaAndUvalues::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_EDIT1, m_editGrossAreaWall1);
	DDX_Control(pDX, IDC_EDIT2, m_editgroosAreaRoof1);
	DDX_Control(pDX, IDC_EDIT3, m_editNetAreaDoors);
	DDX_Control(pDX, IDC_EDIT4, m_editNetAreaWindows);
	DDX_Control(pDX, IDC_EDIT5, m_editNetAreaRoofLights);
	DDX_Control(pDX, IDC_EDIT6, m_editNetAreaGF);
	DDX_Control(pDX, IDC_EDIT7, m_editNetAreaExFloor);
	DDX_Control(pDX, IDC_EDIT8, m_editNetAreaWallType1);
	DDX_Control(pDX, IDC_EDIT9, m_editNetAreaWallType2);
	DDX_Control(pDX, IDC_EDIT10, m_editNetAreaRoofType1);
	DDX_Control(pDX, IDC_EDIT11, m_editNetAreaRoofType2);
	DDX_Control(pDX, IDC_EDIT12, m_editNetAreaPartyWall);
	DDX_Control(pDX, IDC_EDIT13, m_editNetAreaPartyFloor);
	DDX_Control(pDX, IDC_EDIT14, m_editNetAreaPartyCeiling);
	DDX_Control(pDX, IDC_EDIT15, m_editNetAreaInternalWall);
	DDX_Control(pDX, IDC_EDIT16, m_editNetAreaInternalFloor);
	DDX_Control(pDX, IDC_EDIT58, m_editThermalMass);
	DDX_Control(pDX, IDC_EDIT59, m_editLivingRoomFraction);
	DDX_Control(pDX, IDC_EDIT29, m_editUvalueDoors);
	DDX_Control(pDX, IDC_EDIT30, m_editUvalueWindows);
	DDX_Control(pDX, IDC_EDIT31, m_editUvalueRooflights);
	DDX_Control(pDX, IDC_EDIT32, m_editUvalueGF);
	DDX_Control(pDX, IDC_EDIT33, m_editUvalueExposedFloor);
	DDX_Control(pDX, IDC_EDIT34, m_editUvalueWallType1);
	DDX_Control(pDX, IDC_EDIT43, m_editUvalueWallType2);
	DDX_Control(pDX, IDC_EDIT44, m_editUvalueRoofTYpe1);
	DDX_Control(pDX, IDC_EDIT45, m_editUvalueRoofType2);
	DDX_Control(pDX, IDC_EDIT46, m_editUvaluePartyWall);
	DDX_Control(pDX, IDC_EDIT35, m_editkValueGF);
	DDX_Control(pDX, IDC_EDIT36, m_editkValueExpFloor);
	DDX_Control(pDX, IDC_EDIT52, m_editkValueWallType1);
	DDX_Control(pDX, IDC_EDIT37, m_editkValueWallType2);
	DDX_Control(pDX, IDC_EDIT53, m_editkValueRoofType1);
	DDX_Control(pDX, IDC_EDIT38, m_editkValueRoofType2);
	DDX_Control(pDX, IDC_EDIT39, m_editkValuePartyWall);
	DDX_Control(pDX, IDC_EDIT54, m_editkValuePartyFloor);
	DDX_Control(pDX, IDC_EDIT40, m_editkValuePartyCeiling);
	DDX_Control(pDX, IDC_EDIT55, m_editkValueIntWall);
	DDX_Control(pDX, IDC_EDIT56, m_editkValueIntFloor);
	DDX_Control(pDX, IDC_EDIT57, m_editkValueIntCeiling);
	DDX_Text(pDX, IDC_EDIT1, str_editGrossAreaWall1);
	DDX_Text(pDX, IDC_EDIT2, str_editGrossAreaRoof1);
	DDX_Text(pDX, IDC_EDIT3, str_editNetAreaDoors);
	DDX_Text(pDX, IDC_EDIT4, str_editNetAreaWindows);
	DDX_Text(pDX, IDC_EDIT5, str_editNetAreaRoofLights);
	DDX_Text(pDX, IDC_EDIT6, str_editNetAreaGF);
	DDX_Text(pDX, IDC_EDIT7, str_editNetAreaExFloor);
	DDX_Text(pDX, IDC_EDIT8, str_editNetAreaWallType1);
	DDX_Text(pDX, IDC_EDIT9, str_editNetAreaWallType2);
	DDX_Text(pDX, IDC_EDIT10, str_editNetAreaRoofType1);
	DDX_Text(pDX, IDC_EDIT11, str_editNetAreaRoofType2);
	DDX_Text(pDX, IDC_EDIT12, str_editNetAreaPartyWall);
	DDX_Text(pDX, IDC_EDIT13, str_editNetAreaPartyFloor);
	DDX_Text(pDX, IDC_EDIT14, str_editNetAreaPartyCeiling);
	DDX_Text(pDX, IDC_EDIT15, str_editNetAreaInternalWall);
	DDX_Text(pDX, IDC_EDIT16, str_editNetAreaInternalFloor);
	DDX_Control(pDX, IDC_EDIT17, m_editNetAreaInternalCeiling);
	DDX_Text(pDX, IDC_EDIT17, str_editNetAreaInternalCeiling);
	DDX_Text(pDX, IDC_EDIT29, str_editUvalueDoors);
	DDX_Text(pDX, IDC_EDIT30, str_editUvalueWindows);
	DDX_Text(pDX, IDC_EDIT31, str_editUvalueRooflights);
	DDX_Text(pDX, IDC_EDIT32, str_editUvalueGF);
	DDX_Text(pDX, IDC_EDIT33, str_editUvalueExposedFloor);
	DDX_Text(pDX, IDC_EDIT34, str_editUvalueWallType1);
	DDX_Text(pDX, IDC_EDIT43, str_editUvalueWallType2);
	DDX_Text(pDX, IDC_EDIT44, str_editUvalueRoofTYpe1);
	DDX_Text(pDX, IDC_EDIT45, str_editUvalueRoofType2);
	DDX_Text(pDX, IDC_EDIT46, str_editUvaluePartyWall);
	DDX_Text(pDX, IDC_EDIT35, str_editkValueGF);
	DDX_Text(pDX, IDC_EDIT36, str_editkValueExpFloor);
	DDX_Text(pDX, IDC_EDIT52, str_editkValueWallType1);
	DDX_Text(pDX, IDC_EDIT37, str_editkValueWallType2);
	DDX_Text(pDX, IDC_EDIT53, str_editkValueRoofType1);
	DDX_Text(pDX, IDC_EDIT38, str_editkValueRoofType2);
	DDX_Text(pDX, IDC_EDIT39, str_editkValuePartyWall);
	DDX_Text(pDX, IDC_EDIT54, str_editkValuePartyFloor);
	DDX_Text(pDX, IDC_EDIT40, str_editkValuePartyCeiling);
	DDX_Text(pDX, IDC_EDIT55, str_editkValueIntWall);
	DDX_Text(pDX, IDC_EDIT56, str_editkValueIntFloor);
	DDX_Text(pDX, IDC_EDIT57, str_editkValueIntCeiling);
	DDX_Text(pDX, IDC_EDIT58, str_editThermalMass);
	DDX_Text(pDX, IDC_EDIT59, str_editLivingRoomFraction);
	DDX_Control(pDX, IDC_EDIT58, m_editThermalMass);
	DDX_Text(pDX, IDC_EDIT58, str_editThermalMass);
	DDX_Control(pDX, IDC_STATIC_help, m_labelLivingAreaFraction);
}

BEGIN_MESSAGE_MAP(CDlg_AreaAndUvalues, CDialog)
	ON_EN_CHANGE(IDC_EDIT1, OnEnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT2, OnEnChangeEdit2)
	ON_EN_CHANGE(IDC_EDIT58, OnEnChangeEdit58)
	ON_CBN_SELCHANGE(IDC_COMBO8, OnCbnSelchangeCombo8)
	ON_EN_CHANGE(IDC_EDIT59, OnEnChangeEdit59)
	ON_EN_CHANGE(IDC_EDIT3, OnEnChangeEdit3)
	ON_EN_CHANGE(IDC_EDIT4, OnEnChangeEdit4)
	ON_EN_CHANGE(IDC_EDIT5, OnEnChangeEdit5)
	ON_EN_CHANGE(IDC_EDIT6, OnEnChangeEdit6)
	ON_EN_CHANGE(IDC_EDIT7, OnEnChangeEdit7)
	ON_EN_CHANGE(IDC_EDIT8, OnEnChangeEdit8)
	ON_EN_CHANGE(IDC_EDIT9, OnEnChangeEdit9)
	ON_EN_CHANGE(IDC_EDIT10, OnEnChangeEdit10)
	ON_EN_CHANGE(IDC_EDIT11, OnEnChangeEdit11)
	ON_EN_CHANGE(IDC_EDIT12, OnEnChangeEdit12)
	ON_EN_CHANGE(IDC_EDIT13, OnEnChangeEdit13)
	ON_EN_CHANGE(IDC_EDIT14, OnEnChangeEdit14)
	ON_EN_CHANGE(IDC_EDIT15, OnEnChangeEdit15)
	ON_EN_CHANGE(IDC_EDIT16, OnEnChangeEdit16)
	ON_EN_CHANGE(IDC_EDIT17, OnEnChangeEdit17)
	ON_EN_CHANGE(IDC_EDIT29, OnEnChangeEdit29)
	ON_EN_CHANGE(IDC_EDIT30, OnEnChangeEdit30)
	ON_EN_CHANGE(IDC_EDIT31, OnEnChangeEdit31)
	ON_EN_CHANGE(IDC_EDIT32, OnEnChangeEdit32)
	ON_EN_CHANGE(IDC_EDIT33, OnEnChangeEdit33)
	ON_EN_CHANGE(IDC_EDIT34, OnEnChangeEdit34)
	ON_EN_CHANGE(IDC_EDIT43, OnEnChangeEdit43)
	ON_EN_CHANGE(IDC_EDIT44, OnEnChangeEdit44)
	ON_EN_CHANGE(IDC_EDIT45, OnEnChangeEdit45)
	ON_EN_CHANGE(IDC_EDIT46, OnEnChangeEdit46)
	ON_EN_CHANGE(IDC_EDIT35, OnEnChangeEdit35)
	ON_EN_CHANGE(IDC_EDIT36, OnEnChangeEdit36)
	ON_EN_CHANGE(IDC_EDIT52, OnEnChangeEdit52)
	ON_EN_CHANGE(IDC_EDIT37, OnEnChangeEdit37)
	ON_EN_CHANGE(IDC_EDIT53, OnEnChangeEdit53)
	ON_EN_CHANGE(IDC_EDIT38, OnEnChangeEdit38)
	ON_EN_CHANGE(IDC_EDIT39, OnEnChangeEdit39)
	ON_EN_CHANGE(IDC_EDIT54, OnEnChangeEdit54)
	ON_EN_CHANGE(IDC_EDIT40, OnEnChangeEdit40)
	ON_EN_CHANGE(IDC_EDIT55, OnEnChangeEdit55)
	ON_EN_CHANGE(IDC_EDIT56, OnEnChangeEdit56)
	ON_EN_CHANGE(IDC_EDIT57, OnEnChangeEdit57)
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
END_MESSAGE_MAP()

// CDlg_AreaAndUvalues message handlers

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

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

	//-------------------------------------------------------
	// Set all values to default if user selects file>new 
	//-------------------------------------------------------
	if(file_new_selected ==true)
	{
		SetAllValuesToDefault();		
	}

	DisplayValuesFoAreasAndUValuesDlg();

	//-------------------------------------------------------
	//Add tool tips
	//-------------------------------------------------------		
	m_ToolTipLAF= new CToolTipCtrl();
	m_ToolTipLAF->Create(this);
	m_ToolTipLAF->SetMaxTipWidth(500);
	m_ToolTipLAF->AddTool(&m_labelLivingAreaFraction,"The living area is the room marked on a plan as the lounge or living room, or the largest public room (irrespective of usage by particular occupants), together with any rooms not separated from the lounge or living room by doors, and including any cupboards directly accessed from the lounge or living room. Living area does not, however, extend over more than one storey, even when stairs enter the living area directly.");
	m_ToolTipLAF->Activate(TRUE);

	return TRUE;
}

void CDlg_AreaAndUvalues::DisplayValuesFoAreasAndUValuesDlg()
{
	 str_editGrossAreaWall1.Format("%.2f", grossAreaWall1);
	 str_editGrossAreaRoof1.Format("%.2f", groosAreaRoof1);

	 str_editNetAreaDoors.Format("%.2f", netAreaDoors);
	 str_editNetAreaGF.Format("%.2f", netAreaGF);
	 str_editNetAreaExFloor.Format("%.2f", netAreaExFloor);
	
	 str_editNetAreaWallType2.Format("%.2f", netAreaWallType2);
	 str_editNetAreaRoofType2.Format("%.2f", netAreaRoofType2);
	 str_editNetAreaPartyWall.Format("%.2f", netAreaPartyWall);
	 str_editNetAreaPartyFloor.Format("%.2f", netAreaPartyFloor);
	 str_editNetAreaPartyCeiling.Format("%.2f", netAreaPartyCeiling);
	 str_editNetAreaInternalWall.Format("%.2f", netAreaInternalWall);
	 str_editNetAreaInternalFloor.Format("%.2f", netAreaInternalFloor);
	 str_editNetAreaInternalCeiling.Format("%.2f", netAreaInternalCeiling);

	 str_editUvalueDoors.Format("%.2f", UvalueDoors);
	 str_editUvalueWindows.Format("%.2f", UvalueWindows);
	 str_editUvalueRooflights.Format("%.2f", UvalueRooflights);
	 str_editUvalueGF.Format("%.2f", UvalueGF);
	 str_editUvalueExposedFloor.Format("%.2f", UvalueExposedFloor);
	 str_editUvalueWallType1.Format("%.2f", UvalueWallType1);
	 str_editUvalueWallType2.Format("%.2f", UvalueWallType2);
	 str_editUvalueRoofTYpe1.Format("%.2f", UvalueRoofTYpe1);
	 str_editUvalueRoofType2.Format("%.2f", UvalueRoofType2);
	 str_editUvaluePartyWall.Format("%.2f", UvaluePartyWall);

	 str_editkValueGF.Format("%.2f", kValueGF);
	 str_editkValueExpFloor.Format("%.2f", kValueExpFloor);
	 str_editkValueWallType1.Format("%.2f", kValueWallType1);
	 str_editkValueWallType2.Format("%.2f", kValueWallType2);
	 str_editkValueRoofType1.Format("%.2f", kValueRoofType1);
	 str_editkValueRoofType2.Format("%.2f", kValueRoofType2);
	 str_editkValuePartyWall.Format("%.2f", kValuePartyWall);
	 str_editkValuePartyFloor.Format("%.2f", kValuePartyFloor);
	 str_editkValuePartyCeiling.Format("%.2f", kValuePartyCeiling);
	 str_editkValueIntWall.Format("%.2f", kValueIntWall);
	 str_editkValueIntFloor.Format("%.2f", kValueIntFloor);
	 str_editkValueIntCeiling.Format("%.2f", kValueIntCeiling);

	 netAreaWindows = winNArea+   
					  winNEArea+ 
				      winEArea+   
				      winSEArea+ 
				      winSArea+   
			          winSWArea+ 
				      winWArea+   
				      winNWArea;
				    
	 netAreaRoofLights = rooflightsArea;

	 netAreaWallType1 = grossAreaWall1 - netAreaDoors - netAreaWindows;
	 netAreaRoofType1 = groosAreaRoof1 - netAreaRoofLights;

	 TFA = storey1Area +
		  storey2Area +
		  storey3Area +
		  storey4Area +
		  storey5Area +
		  storey6Area;

	if(TFA_from_HEM == true)
	{
		TFA = TFAfromHEM;
	}

	 thermalMassParameter = ((netAreaDoors) + (netAreaWindows)+ (netAreaRoofLights)+ (netAreaGF * kValueGF)+
		(netAreaExFloor * kValueExpFloor) + (netAreaWallType1 * kValueWallType1) +
		(netAreaWallType2 * kValueWallType2)+ (netAreaRoofType1 * kValueRoofType1)+
		(netAreaRoofType2 * kValueRoofType2) + (netAreaPartyWall * kValuePartyWall)+
		(netAreaPartyFloor*kValuePartyFloor) + (netAreaPartyCeiling * kValuePartyCeiling)+
		(netAreaInternalWall * kValueIntWall)+(netAreaInternalFloor * kValueIntFloor)+
		(netAreaInternalCeiling *kValueIntCeiling ))/TFA;

	 if(file_new_selected == true)
	 {
		 thermalMassParameter = 0;
	 }
		 
	 str_editNetAreaWindows.Format("%.2f", netAreaWindows);
	 str_editNetAreaRoofLights.Format("%.2f", netAreaRoofLights);
	 str_editThermalMass.Format("%.2f", thermalMassParameter);
	 str_editLivingRoomFraction.Format("%.2f", livingRoomFraction);
	 str_editNetAreaWallType1.Format("%.2f",netAreaWallType1);
	 str_editNetAreaRoofType1.Format("%.2f",netAreaRoofType1);
	
	 UpdateData(FALSE);
}

void CDlg_AreaAndUvalues::ReadInputsFromAreasAndUValuesDlg()
{
	UpdateData(TRUE);

	grossAreaWall1 = atof(str_editGrossAreaWall1);
	groosAreaRoof1= atof(str_editGrossAreaRoof1);

	netAreaDoors= atof(str_editNetAreaDoors);
	netAreaRoofLights= atof(str_editNetAreaRoofLights);
	netAreaGF= atof(str_editNetAreaGF);
	netAreaExFloor= atof(str_editNetAreaExFloor);
	netAreaWallType2= atof(str_editNetAreaWallType2);
	netAreaRoofType2= atof(str_editNetAreaRoofType2);
	netAreaPartyWall= atof(str_editNetAreaPartyWall);
	netAreaPartyFloor= atof(str_editNetAreaPartyFloor);
	netAreaPartyCeiling= atof(str_editNetAreaPartyCeiling);
	netAreaInternalWall= atof(str_editNetAreaInternalWall);
	netAreaInternalFloor= atof(str_editNetAreaInternalFloor);
	netAreaInternalCeiling= atof(str_editNetAreaInternalCeiling);

	UvalueDoors= atof(str_editUvalueDoors);
	UvalueWindows= atof(str_editUvalueWindows);
	UvalueRooflights= atof(str_editUvalueRooflights);
	UvalueGF= atof(str_editUvalueGF);
	UvalueExposedFloor= atof(str_editUvalueExposedFloor);
	UvalueWallType1= atof(str_editUvalueWallType1);
	UvalueWallType2= atof(str_editUvalueWallType2);
	UvalueRoofTYpe1= atof(str_editUvalueRoofTYpe1);
	UvalueRoofType2= atof(str_editUvalueRoofType2);
	UvaluePartyWall= atof(str_editUvaluePartyWall);

	kValueGF= atof(str_editkValueGF);
	kValueExpFloor= atof(str_editkValueExpFloor);
	kValueWallType1= atof(str_editkValueWallType1);
	kValueWallType2= atof(str_editkValueWallType2);
	kValueRoofType1= atof(str_editkValueRoofType1);
	kValueRoofType2= atof(str_editkValueRoofType2);
	kValuePartyWall= atof(str_editkValuePartyWall);
	kValuePartyFloor= atof(str_editkValuePartyFloor);
	kValuePartyCeiling= atof(str_editkValuePartyCeiling);
	kValueIntWall= atof(str_editkValueIntWall);
	kValueIntFloor= atof(str_editkValueIntFloor);
	kValueIntCeiling= atof(str_editkValueIntCeiling);

	livingRoomFraction= atof(str_editLivingRoomFraction);

	netAreaWindows = winNArea+   
					  winNEArea+ 
				      winEArea+   
				      winSEArea+ 
				      winSArea+   
			          winSWArea+ 
				      winWArea+   
				      winNWArea;
				    
	netAreaRoofLights = rooflightsArea;

	netAreaWallType1 = grossAreaWall1 - netAreaDoors - netAreaWindows;
	netAreaRoofType1 = groosAreaRoof1 - netAreaRoofLights;

	TFA = storey1Area +
		  storey2Area +
		  storey3Area +
		  storey4Area +
		  storey5Area +
		  storey6Area;

	if(TFA_from_HEM == true)
	{
		TFA = TFAfromHEM;
	}

	//thermalMassParameter= atof(str_editThermalMass);
	thermalMassParameter = ((netAreaDoors) + (netAreaWindows)+ (netAreaRoofLights)+ (netAreaGF * kValueGF)+
		(netAreaExFloor * kValueExpFloor) + (netAreaWallType1 * kValueWallType1) +
		(netAreaWallType2 * kValueWallType2)+ (netAreaRoofType1 * kValueRoofType1)+
		(netAreaRoofType2 * kValueRoofType2) + (netAreaPartyWall * kValuePartyWall)+
		(netAreaPartyFloor*kValuePartyFloor) + (netAreaPartyCeiling * kValuePartyCeiling)+
		(netAreaInternalWall * kValueIntWall)+(netAreaInternalFloor * kValueIntFloor)+
		(netAreaInternalCeiling *kValueIntCeiling ))/TFA;

	if(file_new_selected == true)
	{
		thermalMassParameter = 0;
	}

	str_editNetAreaWallType1.Format("%.2f",netAreaWallType1);
	str_editNetAreaRoofType1.Format("%.2f",netAreaRoofType1);
	str_editThermalMass.Format("%.2f",thermalMassParameter);

	UpdateData(FALSE);
}

void CDlg_AreaAndUvalues::OnEnChangeEdit1()
{
	ReadInputsFromAreasAndUValuesDlg();

	// Check limit
	isCheckRange_grossAreaWall1 = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit2()
{
	ReadInputsFromAreasAndUValuesDlg();

	// Check limit
	isCheckRange_groosAreaRoof1  = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit58()
{
	ReadInputsFromAreasAndUValuesDlg();
}

void CDlg_AreaAndUvalues::OnCbnSelchangeCombo8()
{
	ReadInputsFromAreasAndUValuesDlg();
}

void CDlg_AreaAndUvalues::OnEnChangeEdit59()
{
	ReadInputsFromAreasAndUValuesDlg();
}

void CDlg_AreaAndUvalues::OnEnChangeEdit3()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaDoors  = true; 
}

void CDlg_AreaAndUvalues::OnEnChangeEdit4()
{
	ReadInputsFromAreasAndUValuesDlg();
}

void CDlg_AreaAndUvalues::OnEnChangeEdit5()
{
	ReadInputsFromAreasAndUValuesDlg();
}

void CDlg_AreaAndUvalues::OnEnChangeEdit6()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaGF  = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit7()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaExFloor  = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit8()
{
	ReadInputsFromAreasAndUValuesDlg();
}

void CDlg_AreaAndUvalues::OnEnChangeEdit9()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaWallType2   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit10()
{
	ReadInputsFromAreasAndUValuesDlg();
}

void CDlg_AreaAndUvalues::OnEnChangeEdit11()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaRoofType2   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit12()
{
	ReadInputsFromAreasAndUValuesDlg();

	// Check limit
	isCheckRange_netAreaPartyWall   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit13()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaPartyFloor   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit14()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaPartyCeiling   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit15()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaInternalWall   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit16()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaInternalFloor   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit17()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_netAreaInternalCeiling   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit29()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvalueDoors   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit30()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvalueWindows   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit31()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvalueRooflights   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit32()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvalueGF  = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit33()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvalueExposedFloor   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit34()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvalueWallType1    = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit43()
{
	ReadInputsFromAreasAndUValuesDlg();

	// Check limit
	isCheckRange_UvalueWallType2    = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit44()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvalueRoofTYpe1    = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit45()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvalueRoofType2   = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit46()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_UvaluePartyWall = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit35()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueGF  = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit36()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueExpFloor  = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit52()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueWallType1 = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit37()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueWallType2 = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit53()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueRoofType1 = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit38()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueRoofType2 = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit39()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValuePartyWall = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit54()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValuePartyFloor = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit40()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValuePartyCeiling = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit55()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueIntWall = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit56()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueIntFloor = true;
}

void CDlg_AreaAndUvalues::OnEnChangeEdit57()
{
	ReadInputsFromAreasAndUValuesDlg();
	
	// Check limit
	isCheckRange_kValueIntCeiling = true;
}

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

	if(m_ToolTipLAF != NULL)
       m_ToolTipLAF->RelayEvent(pMsg);

	return CDialog::PreTranslateMessage(pMsg);
}


void CDlg_AreaAndUvalues::OnLButtonDown(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default

	CDialog::OnLButtonDown(nFlags, point);
}


