#pragma once
#include "afxcmn.h"
#include "resource.h"
#include "DisasmCtrl.h"
#include "EnterEditCtrl.h"
#include "GFResizeDialogHelper.h"

// DisasmDlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CDisasmDlg dialog
class CDebugger;

class CDisasmDlg : public CDialogEx
{
		GFResizeDialogHelper m_Resizer;
		CFont                m_hFont;
		CDisasmCtrl          m_ListDisasm;
		CEnterEdit           m_EditAddr;
		CDebugger           *m_pDebugger;
		HACCEL               m_hAccelTable;
	public:
		CDisasmDlg(CWnd *pParent = nullptr);   // standard constructor
		virtual ~CDisasmDlg() override;

		CSize               GetMinSize();

		enum { IDD = IDD_BKDISASM_DLG };

		inline CDisasmCtrl *GetDisasmCtrl()
		{
			return &m_ListDisasm;
		}
		void                AttachDebugger(CDebugger *pDebugger);

	protected:
		virtual void DoDataExchange(CDataExchange *pDX) override;    // DDX/DDV support
		virtual BOOL PreTranslateMessage(MSG *pMsg) override;
		LRESULT OnDisasmTopAddressUpdate(WPARAM, LPARAM);
		LRESULT OnDisasmCurrentAddressChange(WPARAM wp, LPARAM);

		LRESULT OnDisasmStepUp(WPARAM, LPARAM);
		LRESULT OnDisasmStepDn(WPARAM, LPARAM);
		LRESULT OnDisasmPgUp(WPARAM wp, LPARAM);
		LRESULT OnDisasmPgDn(WPARAM wp, LPARAM);
		LRESULT OnDisasmCheckBp(WPARAM wp, LPARAM);

		virtual BOOL OnInitDialog() override;
		virtual void OnOK() override;
		virtual void OnCancel() override;
		afx_msg void OnSize(UINT nType, int cx, int cy);
		afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI);
		afx_msg void OnSetFocus(CWnd *pOldWnd);
		DECLARE_MESSAGE_MAP()
};
