#pragma once
#include "colorstatic.h"
#include "afxwin.h"
#include <vector>

// CDlg_Openings dialog

class CDlg_Openings : public CDialog
{
	DECLARE_DYNAMIC(CDlg_Openings)

public:
	CDlg_Openings(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlg_Openings();

// Dialog Data
	enum { IDD = IDD_OPENINGS };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	virtual BOOL OnInitDialog();
	afx_msg void AddStringsForOpeningsDlg();
	afx_msg void ReadPreviousInputsFromOpeningsDlg();
	afx_msg void ReadInputsFromOpeningsDlg();

	DECLARE_MESSAGE_MAP()
public:
	//CColorStatic m_labelDescription;
	CColorStatic m_labelGlazing;
	CColorStatic m_labelSizeLocation;
	CColorStatic m_labelLinkage;
	CColorStatic m_labelFrame;
	CColorStatic m_labelTransmittance;
	CColorStatic m_labelFrameFactor;
	CColorStatic m_labelUvalue;
	CComboBox m_comboFromSource;
	CEdit m_editDescription;
	CComboBox m_comboGlazingType;
	CComboBox m_comboLowECoating;
	CComboBox m_comboUserDefEmissivity;
	CEdit m_editEmissivity;
	CComboBox m_comboArgonFilled;
	CComboBox m_comboGap;
	CEdit m_editPitch;
	CComboBox m_comboOrientation;
	CComboBox m_comboOvershading;
	CEdit m_editWidth;
	CEdit m_editHeight;
	CComboBox m_comboLocationName;
	CEdit m_editOverhangDepth;
	CEdit m_editOverhangWidth;
	CComboBox m_comboMaster;
	CComboBox m_comboLinkedTo;
	CComboBox m_comboFrame;
	CComboBox m_comboThermalBreak;
	CComboBox m_comboDraughtProofing;
	CComboBox m_comboMetalLintel;
	CComboBox m_comboTransmittanceFactor;
	CComboBox m_comboFrameFactor;
	CComboBox m_comboUValue;
	CEdit m_editTransmittance;
	CEdit m_editFractionGlazed;
	CEdit m_editUValue;
	CString str_comboFromSource;
	CString str_editDescription;
	CString str_comboGlazingType;
	CString str_comboLowECoating;
	CString str_comboUserDefEmissivity;
	CString str_editEmissivity;
	CString str_comboArgonFilled;
	CString str_comboGap;
	CString str_editPitch;
	CString str_comboOrientation;
	CString str_comboOvershading;
	CString str_editWidth;
	CString str_editHeight;
	CString str_comboLocationName;
	CString str_editOverhangDepth;
	CString str_editOverhangWidth;
	CString str_comboMaster;
	CString str_comboLinkedTo;
	CString str_comboFrame;
	CString str_comboThermalBreak;
	CString str_comboDraughtProofing;
	CString str_comboMetalLintel;
	CString str_comboTransmittanceFactor;
	CString str_editTransmittance;
	CString str_comboFrameFactor;
	CString str_editFractionGlazed;
	CString str_comboUValue;
	CString str_editUValue;
	afx_msg void OnBnClickedButtonAdd();
	afx_msg void OnBnClickedButtonView();
	afx_msg void OnCbnSelchangeComboSource();
	afx_msg void OnEnChangeEdit1();
	afx_msg void OnCbnSelchangeComboGlazingtype();
	afx_msg void OnCbnSelchangeComboLowe();
	afx_msg void OnCbnSelchangeCombouserdefem();
	afx_msg void OnEnChangeEdit2();
	afx_msg void OnCbnSelchangeComboArgonfilled();
	afx_msg void OnCbnSelchangeComboGap();
	afx_msg void OnEnChangeEdit3();
	afx_msg void OnCbnSelchangeComboOrientation();
	afx_msg void OnCbnSelchangeComboOvershading();
	afx_msg void OnEnChangeEdit4();
	afx_msg void OnEnChangeEdit5();
	afx_msg void OnCbnSelchangeComboLocationname();
	afx_msg void OnEnChangeEdit7();
	afx_msg void OnEnChangeEdit6();
	afx_msg void OnCbnSelchangeComboMaster();
	afx_msg void OnCbnSelchangeComboLinkedto();
	afx_msg void OnCbnSelchangeComboFrame();
	afx_msg void OnCbnSelchangeComboThermalbreak();
	afx_msg void OnCbnSelchangeComboDraughtproofing();
	afx_msg void OnCbnSelchangeComboMetallintel();
	afx_msg void OnCbnSelchangeComboTransfactor();
	afx_msg void OnEnChangeEdit8();
	afx_msg void OnCbnSelchangeComboFramefactor();
	afx_msg void OnEnChangeEdit9();
	afx_msg void OnCbnSelchangeCombouvalue();
	afx_msg void OnEnChangeEdit10();
	CEdit m_editRef;
	CString str_editRef;
	afx_msg void OnEnChangeEdit11();

	CEdit m_editOpeningName;
	CString str_editOpeningName;
	afx_msg void OnEnChangeEdit12();
	CComboBox m_comboOPeningWallRoof;
	CString str_comboOPeningWallRoof;
	afx_msg void OnCbnSelchangeCombo1();

	virtual BOOL PreTranslateMessage(MSG* pMsg);
};


//---------------------------------------------------
// GLOBAL VARIABLES
//---------------------------------------------------
extern CString openingFromSource;
extern CString openingDescription;
extern CString openingGlzType;
extern CString openingLowECoating;
extern CString openingUsedDefEmissivity;
extern double openingEmissivty;

extern CString openingArgonFilled;
extern CString openingGap;
extern double openingPitch; // ???unknown
extern CString openingOrientation;
extern CString openingOvershading;

extern double openingWidth;
extern double openingHeight;
extern CString openingLocationName;
extern double openingOverhangDepth;
extern double openingOverhangWidth;

extern CString openingRef;
extern CString openingLinkageMaster;
extern CString openingLinkedTo;

extern CString openingFrame;
extern CString openingThermalBreak;
extern CString openingDraughtProofing;
extern CString openingMetalLintel;

extern CString openingTransmittanceSelected;
extern double openingTransmittanceFactor;

extern CString openingFrameSelected;
extern double openingFrameFactor;

extern CString openingUvalueSelected;
extern double openingUvalue;
extern CString openingRoofWall;

////////////////////////////////////////
extern CString opening1FromSource;
extern CString opening2FromSource;
extern CString opening3FromSource;
extern CString opening4FromSource;
extern CString opening5FromSource;
extern CString opening6FromSource;
extern CString opening7FromSource;
extern CString opening8FromSource;
extern CString opening9FromSource;
extern CString opening10FromSource;

extern CString opening1Description;
extern CString opening2Description;
extern CString opening3Description;
extern CString opening4Description;
extern CString opening5Description;
extern CString opening6Description;
extern CString opening7Description;
extern CString opening8Description;
extern CString opening9Description;
extern CString opening10Description;

extern CString opening1GlzType;
extern CString opening2GlzType;
extern CString opening3GlzType;
extern CString opening4GlzType;
extern CString opening5GlzType;
extern CString opening6GlzType;
extern CString opening7GlzType;
extern CString opening8GlzType;
extern CString opening9GlzType;
extern CString opening10GlzType;

extern CString opening1LowECoating;
extern CString opening2LowECoating;
extern CString opening3LowECoating;
extern CString opening4LowECoating;
extern CString opening5LowECoating;
extern CString opening6LowECoating;
extern CString opening7LowECoating;
extern CString opening8LowECoating;
extern CString opening9LowECoating;
extern CString opening10LowECoating;

extern CString opening1UsedDefEmissivity;
extern CString opening2UsedDefEmissivity;
extern CString opening3UsedDefEmissivity;
extern CString opening4UsedDefEmissivity;
extern CString opening5UsedDefEmissivity;
extern CString opening6UsedDefEmissivity;
extern CString opening7UsedDefEmissivity;
extern CString opening8UsedDefEmissivity;
extern CString opening9UsedDefEmissivity;
extern CString opening10UsedDefEmissivity;

extern double opening1Emissivty;
extern double opening2Emissivty;
extern double opening3Emissivty;
extern double opening4Emissivty;
extern double opening5Emissivty;
extern double opening6Emissivty;
extern double opening7Emissivty;
extern double opening8Emissivty;
extern double opening9Emissivty;
extern double opening10Emissivty;

extern CString opening1ArgonFilled;
extern CString opening2ArgonFilled;
extern CString opening3ArgonFilled;
extern CString opening4ArgonFilled;
extern CString opening5ArgonFilled;
extern CString opening6ArgonFilled;
extern CString opening7ArgonFilled;
extern CString opening8ArgonFilled;
extern CString opening9ArgonFilled;
extern CString opening10ArgonFilled;

extern CString opening1Gap;
extern CString opening2Gap;
extern CString opening3Gap;
extern CString opening4Gap;
extern CString opening5Gap;
extern CString opening6Gap;
extern CString opening7Gap;
extern CString opening8Gap;
extern CString opening9Gap;
extern CString opening10Gap;

extern double opening1Pitch; // ???unknown
extern double opening2Pitch; // ???unknown
extern double opening3Pitch; // ???unknown
extern double opening4Pitch; // ???unknown
extern double opening5Pitch; // ???unknown
extern double opening6Pitch; // ???unknown
extern double opening7Pitch; // ???unknown
extern double opening8Pitch; // ???unknown
extern double opening9Pitch; // ???unknown
extern double opening10Pitch; // ???unknown

extern CString opening1Orientation;
extern CString opening2Orientation;
extern CString opening3Orientation;
extern CString opening4Orientation;
extern CString opening5Orientation;
extern CString opening6Orientation;
extern CString opening7Orientation;
extern CString opening8Orientation;
extern CString opening9Orientation;
extern CString opening10Orientation;

extern CString opening1Overshading;
extern CString opening2Overshading;
extern CString opening3Overshading;
extern CString opening4Overshading;
extern CString opening5Overshading;
extern CString opening6Overshading;
extern CString opening7Overshading;
extern CString opening8Overshading;
extern CString opening9Overshading;
extern CString opening10Overshading;

extern double opening1Width;
extern double opening2Width;
extern double opening3Width;
extern double opening4Width;
extern double opening5Width;
extern double opening6Width;
extern double opening7Width;
extern double opening8Width;
extern double opening9Width;
extern double opening10Width;

extern double opening1Height;
extern double opening2Height;
extern double opening3Height;
extern double opening4Height;
extern double opening5Height;
extern double opening6Height;
extern double opening7Height;
extern double opening8Height;
extern double opening9Height;
extern double opening10Height;

extern CString opening1LocationName;
extern CString opening2LocationName;
extern CString opening3LocationName;
extern CString opening4LocationName;
extern CString opening5LocationName;
extern CString opening6LocationName;
extern CString opening7LocationName;
extern CString opening8LocationName;
extern CString opening9LocationName;
extern CString opening10LocationName;

extern double opening1OverhangDepth;
extern double opening2OverhangDepth;
extern double opening3OverhangDepth;
extern double opening4OverhangDepth;
extern double opening5OverhangDepth;
extern double opening6OverhangDepth;
extern double opening7OverhangDepth;
extern double opening8OverhangDepth;
extern double opening9OverhangDepth;
extern double opening10OverhangDepth;

extern double opening1OverhangWidth;
extern double opening2OverhangWidth;
extern double opening3OverhangWidth;
extern double opening4OverhangWidth;
extern double opening5OverhangWidth;
extern double opening6OverhangWidth;
extern double opening7OverhangWidth;
extern double opening8OverhangWidth;
extern double opening9OverhangWidth;
extern double opening10OverhangWidth;

extern CString opening1Ref;
extern CString opening2Ref;
extern CString opening3Ref;
extern CString opening4Ref;
extern CString opening5Ref;
extern CString opening6Ref;
extern CString opening7Ref;
extern CString opening8Ref;
extern CString opening9Ref;
extern CString opening10Ref;

extern CString opening1LinkageMaster;
extern CString opening2LinkageMaster;
extern CString opening3LinkageMaster;
extern CString opening4LinkageMaster;
extern CString opening5LinkageMaster;
extern CString opening6LinkageMaster;
extern CString opening7LinkageMaster;
extern CString opening8LinkageMaster;
extern CString opening9LinkageMaster;
extern CString opening10LinkageMaster;

extern CString opening1LinkedTo;
extern CString opening2LinkedTo;
extern CString opening3LinkedTo;
extern CString opening4LinkedTo;
extern CString opening5LinkedTo;
extern CString opening6LinkedTo;
extern CString opening7LinkedTo;
extern CString opening8LinkedTo;
extern CString opening9LinkedTo;
extern CString opening10LinkedTo;

extern CString opening1Frame;
extern CString opening2Frame;
extern CString opening3Frame;
extern CString opening4Frame;
extern CString opening5Frame;
extern CString opening6Frame;
extern CString opening7Frame;
extern CString opening8Frame;
extern CString opening9Frame;
extern CString opening10Frame;

extern CString opening1ThermalBreak;
extern CString opening2ThermalBreak;
extern CString opening3ThermalBreak;
extern CString opening4ThermalBreak;
extern CString opening5ThermalBreak;
extern CString opening6ThermalBreak;
extern CString opening7ThermalBreak;
extern CString opening8ThermalBreak;
extern CString opening9ThermalBreak;
extern CString opening10ThermalBreak;

extern CString opening1DraughtProofing;
extern CString opening2DraughtProofing;
extern CString opening3DraughtProofing;
extern CString opening4DraughtProofing;
extern CString opening5DraughtProofing;
extern CString opening6DraughtProofing;
extern CString opening7DraughtProofing;
extern CString opening8DraughtProofing;
extern CString opening9DraughtProofing;
extern CString opening10DraughtProofing;

extern CString opening1MetalLintel;
extern CString opening2MetalLintel;
extern CString opening3MetalLintel;
extern CString opening4MetalLintel;
extern CString opening5MetalLintel;
extern CString opening6MetalLintel;
extern CString opening7MetalLintel;
extern CString opening8MetalLintel;
extern CString opening9MetalLintel;
extern CString opening10MetalLintel;

extern CString opening1TransmittanceSelected;
extern CString opening2TransmittanceSelected;
extern CString opening3TransmittanceSelected;
extern CString opening4TransmittanceSelected;
extern CString opening5TransmittanceSelected;
extern CString opening6TransmittanceSelected;
extern CString opening7TransmittanceSelected;
extern CString opening8TransmittanceSelected;
extern CString opening9TransmittanceSelected;
extern CString opening10TransmittanceSelected;

extern double opening1TransmittanceFactor;
extern double opening2TransmittanceFactor;
extern double opening3TransmittanceFactor;
extern double opening4TransmittanceFactor;
extern double opening5TransmittanceFactor;
extern double opening6TransmittanceFactor;
extern double opening7TransmittanceFactor;
extern double opening8TransmittanceFactor;
extern double opening9TransmittanceFactor;
extern double opening10TransmittanceFactor;

extern CString opening1FrameSelected;
extern CString opening2FrameSelected;
extern CString opening3FrameSelected;
extern CString opening4FrameSelected;
extern CString opening5FrameSelected;
extern CString opening6FrameSelected;
extern CString opening7FrameSelected;
extern CString opening8FrameSelected;
extern CString opening9FrameSelected;
extern CString opening10FrameSelected;

extern double opening1FrameFactor;
extern double opening2FrameFactor;
extern double opening3FrameFactor;
extern double opening4FrameFactor;
extern double opening5FrameFactor;
extern double opening6FrameFactor;
extern double opening7FrameFactor;
extern double opening8FrameFactor;
extern double opening9FrameFactor;
extern double opening10FrameFactor;

extern CString opening1UvalueSelected;
extern CString opening2UvalueSelected;
extern CString opening3UvalueSelected;
extern CString opening4UvalueSelected;
extern CString opening5UvalueSelected;
extern CString opening6UvalueSelected;
extern CString opening7UvalueSelected;
extern CString opening8UvalueSelected;
extern CString opening9UvalueSelected;
extern CString opening10UvalueSelected;

extern double opening1Uvalue;
extern double opening2Uvalue;
extern double opening3Uvalue;
extern double opening4Uvalue;
extern double opening5Uvalue;
extern double opening6Uvalue;
extern double opening7Uvalue;
extern double opening8Uvalue;
extern double opening9Uvalue;
extern double opening10Uvalue;


extern bool is_opening1_added;
extern bool is_opening2_added;
extern bool is_opening3_added;
extern bool is_opening4_added;
extern bool is_opening5_added;
extern bool is_opening6_added;
extern bool is_opening7_added;
extern bool is_opening8_added;
extern bool is_opening9_added;
extern bool is_opening10_added;