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

  1. #ifndef _ISPINBAS_
  2.   #define _ISPINBAS_
  3. /*******************************************************************************
  4. * FILE NAME: ispinbas.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IBaseSpinButton                                                          *
  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 <icontrol.hpp>
  20. #include <irect.hpp>
  21. #include <ihandle.hpp>
  22.  
  23. class IBaseSpinButtonData;
  24.  
  25. #pragma pack(4)
  26.  
  27. class IBaseSpinButton : public IControl {
  28. typedef IControl
  29.   Inherited;
  30.  
  31. public :
  32.  
  33. /*----------------------------- Constructors ---------------------------------*/
  34. virtual
  35.   ~IBaseSpinButton ( );
  36.  
  37. /*----------------------------- Styles ---------------------------------------*/
  38. INESTEDBITFLAGCLASSDEF2(Style, IBaseSpinButton, IWindow, IControl);
  39.  
  40. static const Style
  41.   IC_IMPORTU master,
  42.   IC_IMPORTU servant,
  43.   IC_IMPORTU readOnly,
  44.   IC_IMPORTU noBorder,
  45.   IC_IMPORTU pmCompatible,
  46.   IC_IMPORTU fastSpin;
  47. #ifndef IC_MOTIFPM_FLAGNOP
  48. static const Style
  49.   IC_IMPORTU border3D;
  50. #endif
  51. static const Style
  52.   IC_IMPORTU leftAlign,
  53.   IC_IMPORTU centerAlign,
  54.   IC_IMPORTU rightAlign;
  55.  
  56.   virtual unsigned long
  57.     convertToGUIStyle ( const IBitFlag& style,
  58.                         Boolean         extendedOnly = false ) const;
  59.  
  60. /*---------------------------- Style Functions -------------------------------*/
  61. enum Alignment {
  62.   left,
  63.   right,
  64.   center
  65. };
  66.  
  67. virtual IBaseSpinButton
  68.   &enableDataUpdate  ( Boolean   writeable = true ),
  69.   &disableDataUpdate ( ),
  70.   &enableFastSpin    ( Boolean   fast      = true ),
  71.   &disableFastSpin   ( ),
  72.   &addBorder         ( Boolean   add       = true ),
  73.   &removeBorder      ( );
  74. #ifndef IC_MOTIFWIN_FLAGNOP
  75. virtual IBaseSpinButton
  76.   &setAlignment      ( Alignment alignment = left );
  77. #endif
  78.  
  79. Boolean
  80.   isMaster          ( ) const,
  81.   isServant         ( ) const,
  82.   isWriteable       ( ) const,
  83.   isFastSpinEnabled ( ) const,
  84.   isPMCompatible    ( ) const,
  85.   hasBorder         ( ) const;
  86.  
  87. Alignment
  88.   alignment  ( ) const;
  89.  
  90. /*----------------------------- Limit and Spin -------------------------------*/
  91. unsigned long
  92.   limit ( ) const;
  93.  
  94. virtual IBaseSpinButton
  95.   &setLimit  ( unsigned long    aNumber = 255 ),
  96.   &setMaster ( IBaseSpinButton& master        ),
  97.   &spinDown  ( unsigned long    spinBy  = 1 ),
  98.   &spinUp    ( unsigned long    spinBy  = 1 );
  99.  
  100. virtual Boolean
  101.   isSpinFieldValid ( Boolean caseSensitive ) const = 0;
  102.  
  103.  
  104. /*--------------------------------- Overrides --------------------------------*/
  105. virtual IBaseSpinButton
  106.  &enable ( Boolean enable = true );
  107.  
  108. virtual IColor
  109.   foregroundColor () const;
  110.  
  111. virtual IColor
  112.   backgroundColor () const;
  113.  
  114. virtual IBaseSpinButton
  115.  &setForegroundColor ( const IColor& color ),
  116.  &setBackgroundColor ( const IColor& color ),
  117.  &resetForegroundColor ( ),
  118.  &resetBackgroundColor ( );
  119.  
  120. /*------------------------- Attributes ---------------------------------------*/
  121. virtual Boolean
  122.   hasFocus            ( ) const;
  123.  
  124.  
  125. /*----------------------- Notification Event Descriptions --------------------*/
  126. static INotificationId const
  127.   IC_IMPORTU valueId,
  128.   IC_IMPORTU textId;
  129.  
  130.  
  131. protected:
  132. /*------------------------------ Implementation ------------------------------*/
  133. virtual ISize
  134.   calcMinimumSize ( ) const;
  135.  
  136. void
  137.   initialize ( unsigned long        windowId,
  138.                const IWindowHandle& parent,
  139.                const IWindowHandle& owner,
  140.                unsigned long        style,
  141.                const IRectangle&    initial );
  142. virtual void
  143.   initialize ( );
  144.  
  145. /*-------------------------- Protected Constructors --------------------------*/
  146.   IBaseSpinButton ( );
  147.  
  148. /*---------------------- Event-Handling Implementation -----------------------*/
  149.  
  150.  
  151. private:
  152. /*------------------------------- Hidden Members -----------------------------*/
  153.   IBaseSpinButton ( const IBaseSpinButton& spinButton );
  154. IBaseSpinButton
  155.  &operator=       ( const IBaseSpinButton& spinButton );
  156.  
  157. /*--------------------------------- Private ----------------------------------*/
  158. friend class IBaseSpinDefaultHandler;
  159.  
  160. IBaseSpinButtonData
  161.  *fBaseSpinButtonData;
  162. };  // IBaseSpinButton
  163.  
  164. INESTEDBITFLAGCLASSFUNCS( Style, IBaseSpinButton);
  165.  
  166. #pragma pack()
  167.  
  168. #endif // _ISPINBAS_
  169.