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

  1. #ifndef _IANIMBUT_
  2. #define _IANIMBUT_
  3. /*******************************************************************************
  4. * FILE NAME: ianimbut.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IAnimatedButton                                                          *
  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. #include <icustbut.hpp>
  19. #include <irect.hpp>
  20.  
  21. class IAnimatedButtonData;
  22. class IBitmapHandle;
  23. class ISize;
  24. class IResourceId;
  25.  
  26. #pragma pack(4)
  27.  
  28.  
  29. class IAnimatedButton : public ICustomButton {
  30. typedef ICustomButton
  31.   Inherited;
  32. public:
  33. class Style;
  34. /*----------------------------- Constructors ---------------------------------*/
  35.   IAnimatedButton  ( unsigned long     id,
  36.                      IWindow*          parent,
  37.                      IWindow*          owner,
  38.                      const IRectangle& initial = IRectangle(),
  39.                      const Style&      style = defaultStyle() );
  40.  
  41.   IAnimatedButton  ( const IWindowHandle& handle );
  42.  
  43. virtual
  44.   ~IAnimatedButton ( );
  45.  
  46. /*-------------------------------- Styles ------------------------------------*/
  47. INESTEDBITFLAGCLASSDEF4(Style, IAnimatedButton, IWindow,
  48.                         IControl, IButton, ICustomButton);
  49.  
  50. static const Style
  51.   IC_IMPORTU animateWhenLatched,
  52.   IC_IMPORTU classDefaultStyle;
  53.  
  54. static Style
  55.   defaultStyle      ( );
  56.  
  57. static void
  58.   setDefaultStyle   ( const Style&    style );
  59.  
  60. virtual unsigned long
  61.   convertToGUIStyle ( const IBitFlag& style,
  62.                       Boolean         extendedOnly = false ) const;
  63.  
  64. /*------------------------ Animated Bitmap Identifiers -----------------------*/
  65. enum AnimatedBitmaps {
  66.   rewind,
  67.   stop,
  68.   pause,
  69.   play,
  70.   fastForward,
  71.   record,
  72.   mute,
  73.   trackAdvance,
  74.   trackReverse,
  75.   stepForward,
  76.   stepBackward,
  77.   scanForward,
  78.   scanBackward,
  79.   eject,
  80.   volumeUp,
  81.   volumeDown
  82. };
  83.  
  84. /*------------------------------ Bitmaps -------------------------------------*/
  85. virtual IAnimatedButton
  86.  &setBitmaps   ( const IResourceId& firstBitmap,
  87.                  unsigned long      count ),
  88.  &setBitmaps   ( AnimatedBitmaps    bitmaps );
  89.  
  90. virtual IBitmapHandle
  91.   bitmap       ( unsigned long index = 0 ) const;
  92.  
  93. virtual unsigned long
  94.   bitmapCount        ( ) const,
  95.   currentBitmapIndex ( ) const;
  96.  
  97. virtual IAnimatedButton
  98.  &setCurrentBitmapIndex ( unsigned long index = 0 );
  99.  
  100. /*-------------------------------- Animation ---------------------------------*/
  101. unsigned long
  102.   animationRate       ( ) const;
  103.  
  104. virtual IAnimatedButton
  105.  &setAnimationRate    ( unsigned long newRate = 1000 ),
  106.  &startAnimation      ( unsigned long index = 0 ),
  107.  &stopAnimation       ( );
  108.  
  109. Boolean
  110.   isAnimationStarted    ( ) const,
  111.   isAnimatedWhenLatched ( ) const;
  112.  
  113. virtual IAnimatedButton
  114.  &enableAnimateWhenLatched  ( Boolean enable = true ),
  115.  &disableAnimateWhenLatched ( ),
  116.  &latch                     ( Boolean latched = true,
  117.                               Boolean refresh = true );
  118.  
  119. protected:
  120. /*----------------------------- Layout Support -------------------------------*/
  121. virtual ISize
  122.   calcMinimumSize ( ) const;
  123.  
  124. private:
  125. /*--------------------------------- Private ----------------------------------*/
  126.   IAnimatedButton            (const IAnimatedButton&);
  127.   IAnimatedButton& operator= (const IAnimatedButton&);
  128. static Style
  129.   fgCurrentDefaultStyle;
  130. IAnimatedButtonData
  131.  *fAnimatedButtonData;
  132. };
  133.  
  134. INESTEDBITFLAGCLASSFUNCS(Style, IAnimatedButton);
  135.  
  136.  
  137. #pragma pack()
  138.  
  139. #endif /* _IANIMBUT_ */
  140.