home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ispinnum.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.7 KB  |  113 lines

  1. #ifndef _ISPINNUM_
  2.   #define _ISPINNUM_
  3. /*******************************************************************************
  4. * FILE NAME: ispinnum.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     INumericSpinButton                                                       *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18.  
  19. #include <ispinbas.hpp>
  20. #include <irect.hpp>
  21.  
  22. class IRange;
  23. class INumericSpinButtonData;
  24.  
  25. #pragma pack(4)
  26.  
  27. class INumericSpinButton : public IBaseSpinButton {
  28. typedef IBaseSpinButton
  29.   Inherited;
  30.  
  31. public :
  32. class Style;
  33. /*------------------------------- Constructors -------------------------------*/
  34.   INumericSpinButton ( unsigned long     id,
  35.                        IWindow*          parent,
  36.                        IWindow*          owner,
  37.                        const IRectangle& initial = IRectangle(),
  38.                        const Style&      style   = defaultStyle() );
  39.  
  40.   INumericSpinButton ( unsigned long     id,
  41.                        IWindow*          parent );
  42.  
  43.   INumericSpinButton ( const IWindowHandle& handle );
  44.  
  45. virtual
  46.  ~INumericSpinButton ( );
  47.  
  48. /*---------------------------------- Styles ----------------------------------*/
  49. INESTEDBITFLAGCLASSDEF3(Style, INumericSpinButton, IBaseSpinButton,
  50.                         IWindow, IControl);
  51.  
  52. static const Style
  53.   IC_IMPORTU classDefaultStyle,
  54.   IC_IMPORTU padWithZeros;
  55.  
  56. static Style
  57.   defaultStyle      ( );
  58.  
  59. static void
  60.   setDefaultStyle   ( const Style&    style );
  61.  
  62.   virtual unsigned long
  63.     convertToGUIStyle ( const IBitFlag& style,
  64.                         Boolean         extendedOnly = false ) const;
  65.  
  66. /*------------------------- Number Range Operations --------------------------*/
  67. virtual INumericSpinButton
  68.  &setRange ( const IRange& aNewRange,
  69.              Boolean       override = false ),
  70.  &spinTo   ( long          aValue,
  71.              Boolean       spinToClosest = false ),
  72.  &setValue ( long aValue );
  73.  
  74. virtual IRange
  75.   range ( ) const;
  76.  
  77. virtual long
  78.   value ( ) const;
  79.  
  80. virtual Boolean
  81.   isSpinFieldValid ( Boolean caseSensitive = false ) const;
  82.  
  83.  
  84. /*-------------------------- Observer Notification ---------------------------*/
  85. virtual INumericSpinButton
  86.  &enableNotification ( Boolean enable=true );
  87.  
  88. protected:
  89.  
  90.  
  91. private:
  92. /*------------------------------ Hidden Members ------------------------------*/
  93. INumericSpinButton ( const INumericSpinButton& spinButton );
  94. INumericSpinButton
  95.  &operator=        ( const INumericSpinButton& spinButton );
  96.  
  97. /*--------------------------------- Private ----------------------------------*/
  98. static Style
  99.   currentDefaultStyle;
  100.  
  101. INumericSpinButtonData
  102.  *fNumericSpinButtonData;
  103.  
  104. };  // INumericSpinButton
  105.  
  106. INESTEDBITFLAGCLASSFUNCS( Style, INumericSpinButton);
  107.  
  108.   #include <ispinnum.inl>
  109.  
  110. #pragma pack()
  111.  
  112. #endif // _ISPINNUM_
  113.