#ifndef CUSTOMEDITCTRL_H #define CUSTOMEDITCTRL_H struct LTEDITCTRLNMHDR { NMHDR hdr ; } ; #define LT_EDITCTRL_NOTIFICATION_LOST_FOCUS 1 #define BUFF_SIZE 100 #define EDT_INTEGER 0 #define EDT_DOUBLE 1 class CCustomEditCtrl : public CEdit { private: L_UINT m_uType; L_UINT m_uPrecent; L_DOUBLE m_dMax; L_DOUBLE m_dMin; LRESULT NotifyParent ( UINT uChildNotifyCode ) ; L_BOOL StringInRange (const TCHAR szText[]); L_BOOL ParseStringSuccess (const TCHAR pStr[]); L_VOID CCustomEditCtrl::GetLeftRightStrings (const TCHAR szText[], TCHAR szLeft[], TCHAR szRight[]); L_VOID GetStringNotLast (TCHAR pOutStr[], const TCHAR pStr[]); L_INT CCustomEditCtrl::GetLengthSum (const TCHAR szFirst [], const TCHAR szSecond[], const TCHAR szThird []); L_VOID CCustomEditCtrl::GetStringNotFirst (TCHAR pOutStr[], const TCHAR pStr[]); public: // Construction CCustomEditCtrl ( ) ; virtual ~CCustomEditCtrl(); L_UINT GetType(); L_BOOL SetType(L_UINT nValue); L_UINT GetPercent(); L_BOOL SetPercent(L_UINT nValue); L_INT GetMaxRange(); L_BOOL SetMaxRange(L_INT nValue); L_INT GetMinRange(); L_BOOL SetMinRange(L_INT nValue); L_BOOL SetNumericEditBox (L_DOUBLE dMinRange, L_DOUBLE dMaxRange, L_DOUBLE dIncrement, L_UINT uPrecesion, L_BOOL bIsDouble); protected: afx_msg void OnKillFocus ( CWnd* pNewWnd ) ; afx_msg void OnChar ( UINT nChar, UINT nRepCnt, UINT nFlags ) ; DECLARE_MESSAGE_MAP() }; #endif //CUSTOMEDITCTRL_H