/*************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/MAPDLG.H__   1.2.1.4   17 Apr 1997 15:55:48   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/MAPDLG.H__  $
** 
**    Rev 1.2.1.4   17 Apr 1997 15:55:48   ZJRD
** No change.
** 
**    Rev 1.2.1.3   16 Apr 1997 10:26:52   ZJRD
** No change.
** 
**    Rev 1.2.1.2   10 Apr 1997 15:37:24   ZJRD
** No change.
** 
**    Rev 1.2.1.1   03 Apr 1997 15:16:54   ZJRD
** No change.
** 
**    Rev 1.2.1.0   28 Mar 1997 10:21:58   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.1   19 Mar 1997 11:32:04   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:47:44   ZJRD
** Initial revision.
** 
**    Rev 1.7.1.0.1.2   09 Dec 1996 10:16:10   ZJRD
** EasyPack/SLD Version 2.0P
** 
**    Rev 1.7.1.0.1.0   11 Nov 1996 12:59:26   ZJRD
** EasyPack/SLD Version 2.01
** 
**    Rev 1.7.1.4   09 Sep 1996 13:18:16   ZJRD
** No change.
** 
**    Rev 1.7.1.3   05 Sep 1996 11:29:48   ZJRD
** EasyPack/SLD Version 1.9e
** 
**    Rev 1.7.1.2   02 Sep 1996 09:56:52   ZJRD
** No change.
** 
**    Rev 1.7.1.1   28 Aug 1996 15:51:22   ZJRD
** EasyPack/SLD Version 1.9b
**************************************************************************/
// mapdlg1.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CMapDlg dialog
class CMapColorBtn;

class CMapDlg : public CDialog
{
protected:
   CMapColorBtn btnIRW, btnIR, btnERW, btnER, btnGuard, btnCRW, btnCR;
   int   m_nArea;
   CRect m_ViewRect;
   BOOL  m_bCapture;
   //BOOL  m_bStart, m_bEnd;
   DWORD m_dwStartAddr, m_dwEndAddr, m_dwCurAddr;
   BOOL  m_bFirst;
   int   m_nSelectLast;
   int   m_nStartBlock, m_nEndBlock;
   int   m_nLastBlock, m_nCurBlock;
   int   m_nSplitBlock; 
   BOOL  m_bFirstFlag;
            
   struct tagBlock{
      CRect m_block;
      int   attribute;
   }m_block[512/*64*/];                 // 64K Byte
   DWORD m_dwxMin, m_dwxMax, m_dwpMin, m_dwpMax;
   int   m_nColorIndex;
      
// Construction
public:
   CMapDlg(CWnd* pParent = NULL, BOOL bFlag=0);   // standard constructor

// Dialog Data
   //{{AFX_DATA(CMapDlg)
   enum { IDD = IDD_MAPDLG };
   CButton  m_ctrlUndo;
   CButton  m_ctrlMapEdit;
   CStatic  m_ctrlCurAddr;
   CStatic  m_ctrlMapView;
   CListBox m_ctrlListMap;
   CStatic  m_ctrlStartAddr;
   CStatic  m_ctrlEndAddr;
   int      m_nAreaSelect;
   //}}AFX_DATA

// Implementation
protected:
   void  InitBtn();
   void  BtnProcess(int nWhichBtn);
   void  DrawAreaMap(int nWhichArea);
   void  DrawInitMap(int nWhichArea);
   void  DrawMapView();
   void  InitMapView(DWORD startAddress, DWORD endAddrss, int attrib);
   void  DrawBlock(CDC *pDC, int nWhichBlock, CBrush* brush, CPen* pen);
   void  DrawBlockFrame(CDC *pDC, int nWhichBlock, CPen* pen);
   void  DrawAllBlockFrame();
   BOOL  GetListSelect(int nSelectLast);
   void  DrawSelectMap(int nSelectLast, CDC* pDC);
   void  GetMap(int nWhichArea);
   void  GetInitMap(int nWhichArea);
   BOOL CMapDlg::FindMapSave();

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

   // Generated message map functions
   //{{AFX_MSG(CMapDlg)
   virtual BOOL OnInitDialog();
   afx_msg void OnMapRestore();
   afx_msg void OnMapSave();
   afx_msg void OnMapSet();
   afx_msg void OnBtnCr();
   afx_msg void OnBtnCrw();
   afx_msg void OnBtnEr();
   afx_msg void OnBtnErw();
   afx_msg void OnBtnG();
   afx_msg void OnBtnIr();
   afx_msg void OnBtnIrw();
   afx_msg void OnRdata();
   afx_msg void OnRprogram();
   afx_msg void OnPaint();
   afx_msg void OnMouseMove(UINT nFlags, CPoint point);
   afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
   afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
   afx_msg void OnMapEdit();
   afx_msg void OnSelchangeMapList();
   afx_msg void OnSetfocusMapList();
   afx_msg void OnKillfocusMapList();
   afx_msg void OnMapUndo();
	afx_msg void OnRbank1();
	afx_msg void OnRbank2();
	afx_msg void OnRbank3();
	afx_msg void OnRbank4();
	//}}AFX_MSG
   DECLARE_MESSAGE_MAP()
};
