
/***************************************************************************
**
**    $Header:   D:/EPSLDV1/SRC/LOG/CPUWIN.H__   1.8   20 Jun 1996 09:30:52   ZJRD  $
**
**    $Log:   D:/EPSLDV1/SRC/LOG/CPUWIN.H__  $
** 
**    Rev 1.8   20 Jun 1996 09:30:52   ZJRD
** EasyPack/SLD Version 1.20a
** 
**    Rev 1.6   10 Jun 1996 10:25:30   ZJRD
** EasyPack/SLD Version 1.20
** 
**    Rev 1.4   29 May 1996 09:38:30   ZJRD
** No change.
** 
**    Rev 1.3   16 May 1996 09:00:48   ZJRD
** No change.
** 
**    Rev 1.2   10 May 1996 09:15:14   ZJRD
** No change.
** 
**    Rev 1.1   02 May 1996 10:23:10   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.31   18 Apr 1996 13:03:00   Shirley
** No change.
** 
**    Rev 1.30   12 Apr 1996 10:37:04   Shirley
** EasyPack/SLD Version 1.90
** 
**    Rev 1.28   15 Feb 1996 08:50:02   Shirley
** No change.
** 
**    Rev 1.27   12 Feb 1996 14:02:30   Shirley
** No change.
** 
**    Rev 1.26   06 Feb 1996 15:27:46   Shirley
** No change.
** 
**    Rev 1.25   06 Feb 1996 13:43:22   Shirley
** No change.
** 
**    Rev 1.24   01 Feb 1996 10:16:16   Shirley
** No change.
** 
**    Rev 1.23   26 Jan 1996 09:13:06   Shirley
** No change.
** 
**    Rev 1.22   25 Jan 1996 13:13:46   Shirley
** No change.
** 
**    Rev 1.21   24 Jan 1996 10:39:32   Shirley
** No change.
** 
**    Rev 1.20   23 Jan 1996 11:28:22   Shirley
** No change.
** 
**    Rev 1.19   18 Jan 1996 10:10:18   Shirley
** No change.
** 
**    Rev 1.18   15 Jan 1996 16:17:32   Shirley
** EasyPack/SLD Version 0.34a
** 
**    Rev 1.17   04 Jan 1996 11:12:06   Shirley
** No change.
** 
**    Rev 1.16   30 Nov 1995 09:08:44   Shirley
** No change.
** 
**    Rev 1.15   28 Nov 1995 15:31:32   Shirley
** No change.
** 
**    Rev 1.14   21 Nov 1995 11:18:12   Shirley
** No change.
** 
**    Rev 1.13   13 Nov 1995 09:28:24   Shirley
** No change.
** 
**    Rev 1.12   12 Nov 1995 11:30:12   Shirley
** EasyPack/SLD Version 0.24
** 
**    Rev 1.11   08 Nov 1995 16:33:28   Shirley
** No change.
** 
**    Rev 1.10   08 Nov 1995 12:43:10   Shirley
** No change.
** 
**    Rev 1.9   02 Nov 1995 10:04:00   Shirley
** No change.
** 
**    Rev 1.8   27 Oct 1995 16:50:38   Shirley
** No change.
** 
**    Rev 1.7   27 Oct 1995 13:47:02   Shirley
** No change.
** 
**    Rev 1.6   25 Oct 1995 14:30:00   Shirley
** No change.
** 
**    Rev 1.5   18 Oct 1995 14:48:30   Shirley
** No change.
** 
**    Rev 1.4   13 Oct 1995 13:21:36   Shirley
** No change.
** 
**    Rev 1.3   29 Sep 1995 09:52:40   Shirley
** No change.
** 
**    Rev 1.2   20 Sep 1995 10:52:32   Shirley
** No change.
** 
**    Rev 1.1   15 Sep 1995 09:44:40   Shirley
** No change.
** 
**    Rev 1.0   07 Sep 1995 09:53:20   Shirley
** Initial revision.
**
****************************************************************************/

/////////////////////////////////////////////////////////////////////////////
//
//  File name:  CPUWIN.H
//
//  Description:The header file for the class: CCpuWindow
//
//  Author:     Roger Zhang
//
//  Date:       04/12/95
//
//  Modification:
//
//      1. 04/12/95, Initial version 
//
//
//  Copyright (C) 1995 Microtek International. All rights reserved.
//
/////////////////////////////////////////////////////////////////////////////

#ifndef _CPUWIN_
#define _CPUWIN_                                            
                                            
/////////////////////////////////////////////////////////////////////////////
// CCpuWindow frame

class CCpuWindow : public CMDIChildWnd
{
    DECLARE_DYNCREATE(CCpuWindow)
public:
    CCpuWindow();           
    BOOL Create(LPCSTR szTitle, LONG style = 0,
        const RECT& rect = rectDefault, CMDIFrameWnd * pParent = NULL );

// Attributes
public:
    enum { NAME_LEN = 7, VAL_LEN = 5 };
    
    BOOL	m_isSel;
    
    UINT	m_OldValue[MAX_REGISTERS];
    UINT	m_NewValue[MAX_REGISTERS];
	void 	SaveOldValue(void);
    
// Operations
public:
    void ShowRegValue(CDC * pdc, int nIdx, UINT uVal, BOOL isNormal);
    BOOL GetRegs(void);

// Implementation
protected:
    static CMenu NEAR m_menu;
    int m_nFont;
    CSize m_szFont;
    CSize m_szName;
    CSize m_szValue;
    CSize m_szGap;    
    CPoint m_ptFirst;
    int m_nCols;
    int m_nRows;
    CSize m_szScroll;
        

    virtual ~CCpuWindow();
    void CalcXY(int nIdx, int &x, int &y);
    void CalcPoint(BOOL isName, int nIdx, int &x, int &y);
    void DrawFrame(CDC * pdc, BOOL isName, int nIdx, int nConvex);
    void ShowRegName(CDC * pdc, int nIdx);
    void Resize(int cx, int cy);

//    virtual BOOL PreCreateWindow(CREATESTRUCT & cs);
    // Generated message map functions
    //{{AFX_MSG(CCpuWindow)
    afx_msg LONG OnXMRepaint(UINT wParam, LONG lParam);
    afx_msg void OnPaint();
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
    afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnViewConfigregisters();
    afx_msg void OnViewDecimal();
    afx_msg void OnUpdateViewDecimal(CCmdUI* pCmdUI);
    afx_msg void OnViewHexadecimal();
    afx_msg void OnUpdateViewHexadecimal(CCmdUI* pCmdUI);
    afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
    afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);
    afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
    afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
    afx_msg void OnRunReset();
	afx_msg void OnViewRefresh();
	afx_msg void OnClose();
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

#endif
////////////////////////////(EOF)////////////////////////////////////////////
