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

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

#ifndef _PAREDIT_
#define _PAREDIT

class CParsedEdit : public CEdit
{
protected:
    WORD    m_wParseStyle;      
    long    m_nMin, m_nMax;           
    
public:
// Construction
    CParsedEdit();

    BOOL Create(DWORD dwStyle /* includes PES_ style*/, const RECT& rect,
        CWnd* pParentWnd, UINT nID);
    BOOL SubclassEdit(UINT nID, CWnd* pParent, WORD wParseStyle);
    static BOOL RegisterControlClass();
    void SetRange(int nMin, int nMax) 
    { 
        ASSERT(nMax >= nMin);
        m_nMin = nMin; m_nMax = nMax; 
    }
    
// Overridables
    virtual void OnBadInput();

// Implementation
protected:
    //{{AFX_MSG(CParsedEdit)
    afx_msg void OnChar(UINT, UINT, UINT); // for character validation
    afx_msg void OnVScroll(UINT, UINT, CScrollBar*); // for spin buttons
    //}}AFX_MSG

    DECLARE_MESSAGE_MAP()
};

/////////////////////////////////
// Parsed edit control sub-styles

#define PES_NUMBERS         0x0001
#define PES_LETTERS         0x0002
#define PES_OTHERCHARS      0x0004
#define PES_ALL             0xFFFF

/////////////////////////////////////////////////////////////////////////////
// Extra control notifications

// above the range for normal EN_ messages
#define PEN_ILLEGALCHAR     0x8000
            // sent to parent when illegal character hit
            // return 0 if you want parsed edit to beep

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