Leaked source code of windows server 2003
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.

205 lines
6.5 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. spinobj.hxx
  7. This is the header file of all the spin button objects
  8. which consists of:
  9. o Elapse Time entry
  10. o Disk space subclass
  11. FILE HISTORY:
  12. terryk 28-Jun-91 Created
  13. terryk 22-JUl-91 Add QuerySmallXXXValue() to SPIN_SLE_VALID_SECOND
  14. terryk 28-Jul-91 Add QueryMinWin() and QuerySecWin() to ETC
  15. terryk 12-Aug-91 Add fActive parameter to the constructor
  16. terryk 16-Aug-91 Change the SPIN_SLE_SECOND constructor to
  17. add INC_VALUE
  18. terryk 11-Nov-91 Change the return type to LONG
  19. terryk 17-Apr-92 Change the return type to ULONG
  20. */
  21. #ifndef _SPINOBJ_HXX_
  22. #define _SPINOBJ_HXX_
  23. #include "bltgroup.hxx"
  24. /*********************************************************************
  25. NAME: SPIN_SLE_VALID_SECOND
  26. SYNOPSIS: This class will increase the internal value to the multiple
  27. of 15 or decrease the internal value to the multiple of 15.
  28. INTERFACE:
  29. SPIN_SLE_VALID_SECOND() - constructor
  30. QuerySmallIncValue() - return the next multiple of 15
  31. QueryBigIncValue() - same as QuerySmallIncValue
  32. QuerySmallDecValue() - return the last multiple of 15
  33. QueryBigDecValue() - same as QuerySmallDecValue
  34. PARENT: SPIN_SLE_NUM_VALID
  35. USES: OWNER_WINDOW
  36. HISTORY:
  37. Terryk 28-Jul-91 Created
  38. terryk 22-Jul-91 Add QuerySmallXXXValue() as virtual functions
  39. *********************************************************************/
  40. DLL_CLASS SPIN_SLE_VALID_SECOND : public SPIN_SLE_NUM_VALID
  41. {
  42. private:
  43. LONG _nSecondInc;
  44. public:
  45. SPIN_SLE_VALID_SECOND( OWNER_WINDOW * powin, CID cid,
  46. LONG nValue=0, LONG nMin=0,
  47. LONG dRange=0, LONG nSecondInc = 0,
  48. BOOL fWrap=TRUE );
  49. virtual ULONG QuerySmallIncValue() const;
  50. virtual ULONG QueryBigIncValue() const;
  51. virtual ULONG QuerySmallDecValue() const;
  52. virtual ULONG QueryBigDecValue() const;
  53. };
  54. /**********************************************************************
  55. NAME: ELAPSED_TIME_CONTROL
  56. SYNOPSIS: Elapsed time control entry. It consists of 2 fields: the
  57. minute field and the second field.
  58. INTERFACE:
  59. ELAPSED_TIME_CONTROL() - constructor
  60. QueryMinWin() - return the minute window pointer
  61. QuerySecWin() - return the second window pointer
  62. SetMinuteMin() - set the min value of the minute field
  63. SetMinuteRange() - set the range of the minute field
  64. SetMinuteValue() - set the value of the minute field
  65. QueryMinuteValue() - return the minute value
  66. SetSecondMin() - set the min value of the second field
  67. SetSecondRange() - set the range value of the second field
  68. SetSecondValue() - set the value of the second field
  69. QuerySecondValue() - return the second value
  70. PARENT: SPIN_GROUP
  71. USES: OWNER_WINDOW, SPIN_SLE_NUM_VALID, SPIN_SLE_SEPARATOR,
  72. SPIN_SLE_VALID_SECOND
  73. HISTORY:
  74. terryk 28-Jun-91 Created
  75. terryk 28-Jul-91 Add QueryMinWin and QuerySecWin
  76. beng 04-Oct-1991 Win32 conversion
  77. **********************************************************************/
  78. DLL_CLASS ELAPSED_TIME_CONTROL : public SPIN_GROUP
  79. {
  80. private:
  81. SPIN_SLE_NUM_VALID _spsleMinute;
  82. SPIN_SLT_SEPARATOR _spsltSeparator;
  83. SPIN_SLE_VALID_SECOND _spsleSecond;
  84. APIERR SetSpinItemAccKey( SPIN_ITEM * psi, SLT & slt, INT cchPos );
  85. public:
  86. ELAPSED_TIME_CONTROL( OWNER_WINDOW * powin,
  87. CID cidMinute,
  88. CID cidSeparator,
  89. CID cidSecond,
  90. CID cidSpinButton,
  91. CID cidUpArrow,
  92. CID cidDownArrow,
  93. SLT & sltMinuteStr,
  94. LONG nMinuteDefault,
  95. LONG nMinuteMin,
  96. LONG dMinuteRange,
  97. SLT & sltSeparatorStr,
  98. SLT & sltSecondStr,
  99. LONG nSecondDefault,
  100. LONG nSecondMin,
  101. LONG dSecondRange,
  102. LONG dSecondInc,
  103. BOOL fActive = FALSE );
  104. WINDOW *QueryMinWin() const
  105. { return (WINDOW *) & _spsleMinute; }
  106. WINDOW *QuerySecWin() const
  107. { return (WINDOW *) & _spsleSecond; }
  108. VOID SetMinuteMin( const LONG nMin );
  109. VOID SetMinuteRange( const LONG dRange );
  110. VOID SetMinuteValue( const LONG nValue );
  111. LONG QueryMinuteValue() const;
  112. VOID SetSecondMin( const LONG nMin );
  113. VOID SetSecondRange( const LONG dRange );
  114. VOID SetSecondValue( const LONG nValue );
  115. LONG QuerySecondValue() const ;
  116. VOID SetMinuteFieldName( MSGID nIDS );
  117. VOID SetSecondFieldName( MSGID nIDS );
  118. };
  119. /**********************************************************************
  120. NAME: DISK_SPACE_SUBCLASS
  121. SYNOPSIS: Disk space subclass. It has 2 fields - the unit field and
  122. the value field.
  123. INTERFACE: DISK_SPACE_SUBCLASS() - constructor
  124. QueryDiskSpace() - return the disk space value
  125. QueryUnit() - return the disk space unit
  126. PARENT: SPIN_GROUP
  127. HISTORY:
  128. terryk 28-Jun-91 Created
  129. beng 04-Oct-1991 Win32 conversion
  130. **********************************************************************/
  131. DLL_CLASS DISK_SPACE_SUBCLASS : public SPIN_GROUP
  132. {
  133. private:
  134. SPIN_SLE_NUM_VALID _spsleDiskSpace; // disk space value
  135. SPIN_SLE_STR _spsleUnit; // disk space unit
  136. LONG _nStartUnit;
  137. public:
  138. DISK_SPACE_SUBCLASS( OWNER_WINDOW * powin, CID cidSpinButton,
  139. CID cidUpArrow, CID cidDownArrow,
  140. CID cidDiskSpace, CID cidUnit,
  141. LONG nInitDSValue = 1, LONG nMinDS = 0,
  142. LONG nRangeDS = 999, LONG nStartUnit = IDS_K,
  143. LONG nUnit = 4, BOOL fActive = TRUE );
  144. VOID SetDSFieldName( MSGID nIDS );
  145. VOID SetDiskSpaceValue( LONG nValue )
  146. { _spsleDiskSpace.SetValue( nValue );
  147. _spsleDiskSpace.Update(); }
  148. VOID SetUnit( LONG nValue )
  149. { _spsleUnit.SetValue( nValue );
  150. _spsleUnit.Update(); }
  151. LONG QueryDiskSpace() const
  152. { return _spsleDiskSpace.QueryValue(); }
  153. LONG QueryUnit() const
  154. { return _nStartUnit + _spsleUnit.QueryValue(); }
  155. };
  156. #endif // _SPINOBJ_HXX_