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.

94 lines
3.2 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. bltssn.hxx
  7. Header file for the SPIN_SLE_NUM object
  8. FILE HISTORY:
  9. terryk 16-Apr-1991 created
  10. terryk 10-Jul-1991 second code review change. Attend:
  11. beng rustanl chuckc annmc terryk
  12. terryk 11-Nov-1991 Change the return type to LONG
  13. terryk 22-Mar-1992 Changed LONG to ULONG
  14. terryk 20-Apr-1992 Saved the value during validation time
  15. */
  16. #ifndef _BLTSSN_HXX_
  17. #define _BLTSSN_HXX_
  18. #include "bltctrl.hxx"
  19. #include "bltedit.hxx"
  20. /**********************************************************************
  21. NAME: SPIN_SLE_NUM
  22. SYNOPSIS: SPIN ITEM object which handles numerical input
  23. INTERFACE:
  24. SPIN_SLE_NUM() - constructor
  25. ~SPIN_SLE_NUM() - destructor
  26. QueryContent() - get the current window context
  27. SaveCurrentData() - get the current window context
  28. and save it to the internal variable.
  29. Update() - update the screen value
  30. PARENT: SLE, CHANGEABLE_SPIN_ITEM
  31. HISTORY:
  32. terryk 23-May-91 Created
  33. beng 04-Oct-1991 Win32 conversion
  34. **********************************************************************/
  35. DLL_CLASS SPIN_SLE_NUM: public SLE, public CHANGEABLE_SPIN_ITEM
  36. {
  37. private:
  38. BOOL _fActive; // set whether the item next to update
  39. // or not
  40. static const TCHAR * _pszClassName; // default window class type
  41. INT _cchMaxInput; // max input character
  42. BLT_BACKGROUND_EDIT * _pbkgndframe; // background edit frame
  43. VOID SetMaxInput(); // set the max input character length
  44. VOID DisplayNum( ULONG nValue ); // display the given number to the
  45. // text window
  46. protected:
  47. virtual BOOL OnChar( const CHAR_EVENT & event );
  48. virtual BOOL OnEnter( const CONTROL_EVENT & event );
  49. virtual BOOL OnDefocus( const FOCUS_EVENT &event );
  50. virtual BOOL OnFocus( const FOCUS_EVENT &event );
  51. virtual BOOL OnKeyDown( const VKEY_EVENT &event );
  52. public:
  53. SPIN_SLE_NUM( OWNER_WINDOW * powin, CID cidEdit,
  54. ULONG nValue=0, ULONG nMin=0,
  55. ULONG dRange=0, BOOL fWrap=TRUE, CID cidFrame = -1);
  56. SPIN_SLE_NUM( OWNER_WINDOW * powin, CID cidEdit,
  57. XYPOINT xy, XYDIMENSION dxy, ULONG flStyle =
  58. ES_CENTER | ES_MULTILINE | WS_TABSTOP | WS_CHILD,
  59. ULONG nValue=0, ULONG nMin=0,
  60. ULONG dRange=0, BOOL fWrap=TRUE, CID cidFrame = -1);
  61. ~SPIN_SLE_NUM( );
  62. VOID QueryContent( ULONG * pnValue ) const;
  63. VOID QueryContent( NLS_STR * pnlsStr ) const;
  64. VOID QueryContent( TCHAR * pszBuf, UINT cbBufSize ) const;
  65. APIERR SaveCurrentData( );
  66. VOID Update();
  67. VOID SetMin( const ULONG nMin );
  68. VOID SetRange( const ULONG dRange );
  69. APIERR SetSaveValue( const ULONG nValue );
  70. virtual APIERR Validate() { return SaveCurrentData(); };
  71. };
  72. #endif // _BLTSSN_HXX_