#pragma once
#include "BaseDialog.h"
#include "Config.h"
#include "resource.h"       // основные символы


// Диалоговое окно Settings_1

class BKSettDlg_1 : public CBaseDialog
{
		DECLARE_DYNAMIC(BKSettDlg_1)

		// HDD Path's
		enum class DrvNmOP : int { NONE, EXCHANGE, REPLACE };
		struct DrvNmInfo
		{
			UINT nDlgID{ 0 };
			fs::path Old;
			fs::path New;
			DrvNmOP Operation{ DrvNmOP::NONE };
		};

		std::array<DrvNmInfo, HDD_MODE::NUM_HDD> m_aHDD
		{
			{
				{ IDC_EDIT_SETT_HDD0, g_strEmptyUnit, g_strEmptyUnit, DrvNmOP::NONE },
				{ IDC_EDIT_SETT_HDD1, g_strEmptyUnit, g_strEmptyUnit, DrvNmOP::NONE }
			} };

		std::array<DrvNmInfo, FDD_DRIVE::NUM_FDD> m_aFDD
		{
			{
				{ IDC_EDIT_SETT_FDDA, g_strEmptyUnit, g_strEmptyUnit, DrvNmOP::NONE },
				{ IDC_EDIT_SETT_FDDB, g_strEmptyUnit, g_strEmptyUnit, DrvNmOP::NONE },
				{ IDC_EDIT_SETT_FDDC, g_strEmptyUnit, g_strEmptyUnit, DrvNmOP::NONE },
				{ IDC_EDIT_SETT_FDDD, g_strEmptyUnit, g_strEmptyUnit, DrvNmOP::NONE }
			} };

		std::array<CString, NUMBER_VIEWS_MEM_DUMP> m_arStrCurrDumpAddr;
		CString m_strCurrDisasmAddr;
		CString m_strCurrCPURunAddr;
		int m_nCurrCPUFrequency{ 0 };

	public:
		BKSettDlg_1(CWnd *pParent = nullptr);   // стандартный конструктор
		virtual ~BKSettDlg_1() override;
		enum { IDD = IDD_SETTINGS_1 };

	protected:
		virtual void DoDataExchange(CDataExchange *pDX) override;    // поддержка DDX/DDV
		virtual BOOL OnInitDialog() override;
		virtual void OnOK() override;
		virtual void OnCancel() override;

		DWORD Save();

		void GetFileImage(const HDD_MODE::HDD_MODE eDrive);
		void GetFileImage(const FDD_DRIVE::FDD_DRIVE eDrive);
		void LoadFileImage(const HDD_MODE::HDD_MODE eDrive);
		void LoadFileImage(const FDD_DRIVE::FDD_DRIVE eDrive);
		void LoadFileImage_1(const CString &strFilterIMG, DrvNmInfo &di);
		void ClearImgPath(const HDD_MODE::HDD_MODE eDrive);
		void ClearImgPath(const FDD_DRIVE::FDD_DRIVE eDrive);
		void ClearImgPath_1(DrvNmInfo &di);
		void RenewFileImage_1(const fs::path &strImgName, DrvNmInfo &di);
		DWORD SaveDrvImgName(const HDD_MODE::HDD_MODE eDrive);
		DWORD SaveDrvImgName(const FDD_DRIVE::FDD_DRIVE eDrive);

		void MakeNewEmptyImage(const FDD_DRIVE::FDD_DRIVE eDrive);

		afx_msg void OnBnClickedSelect0();
		afx_msg void OnBnClickedSelect1();
		afx_msg void OnBnClickedExchange();
		afx_msg LRESULT OnSendToTab(WPARAM, LPARAM);
		afx_msg void OnBnClickedButtonClearHdd0();
		afx_msg void OnBnClickedButtonClearHdd1();
		afx_msg void OnBnClickedButtonClearFddA();
		afx_msg void OnBnClickedButtonClearFddB();
		afx_msg void OnBnClickedButtonClearFddC();
		afx_msg void OnBnClickedButtonClearFddD();
		afx_msg void OnBnClickedButtonSelectFddA();
		afx_msg void OnBnClickedButtonSelectFddB();
		afx_msg void OnBnClickedButtonSelectFddC();
		afx_msg void OnBnClickedButtonSelectFddD();
		afx_msg void OnBnClickedButtonSettNewFddA();
		afx_msg void OnBnClickedButtonSettNewFddB();
		afx_msg void OnBnClickedButtonSettNewFddC();
		afx_msg void OnBnClickedButtonSettNewFddD();
		DECLARE_MESSAGE_MAP()
};
