Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.0 KiB

  1. // paredit.h: C++ derived edit control for numbers/letters etc
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CParsedEdit is a specialized CEdit control that only allows characters
  14. // of a given type.
  15. // This class is used in 3 different ways in the samples
  16. class CParsedEdit : public CEdit
  17. {
  18. protected:
  19. WORD m_wParseStyle; // C++ member data
  20. public:
  21. // Construction
  22. CParsedEdit();
  23. // explicit construction (see DERTEST.CPP)
  24. BOOL Create(DWORD dwStyle /* includes PES_ style*/, const RECT& rect,
  25. CWnd* pParentWnd, UINT nID);
  26. // subclassed construction (see SUBTEST.CPP)
  27. BOOL SubclassEdit(UINT nID, CWnd* pParent, WORD wParseStyle);
  28. // for WNDCLASS Registered window
  29. static BOOL RegisterControlClass();
  30. // Overridables
  31. virtual void OnBadInput();
  32. // Implementation
  33. protected:
  34. //{{AFX_MSG(CParsedEdit)
  35. afx_msg void OnChar(UINT, UINT, UINT); // for character validation
  36. afx_msg void OnVScroll(UINT, UINT, CScrollBar*); // for spin buttons
  37. //}}AFX_MSG
  38. DECLARE_MESSAGE_MAP()
  39. };
  40. /////////////////////////////////
  41. // Parsed edit control sub-styles
  42. #define PES_NUMBERS 0x0001
  43. #define PES_LETTERS 0x0002
  44. #define PES_OTHERCHARS 0x0004
  45. #define PES_ALL 0xFFFF
  46. /////////////////////////////////////////////////////////////////////////////
  47. // Extra control notifications
  48. // above the range for normal EN_ messages
  49. #define PEN_ILLEGALCHAR 0x8000
  50. // sent to parent when illegal character hit
  51. // return 0 if you want parsed edit to beep
  52. /////////////////////////////////////////////////////////////////////////////