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

  1. #ifndef _ICUSTBUT_
  2. #define _ICUSTBUT_
  3. /*******************************************************************************
  4. * FILE NAME: icustbut.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     ICustomButton                                                            *
  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 <ibutton.hpp>
  19. #include <irect.hpp>
  20. #include <icolor.hpp>
  21.  
  22. class ISize;
  23. class ICustomButtonData;
  24.  
  25. #pragma pack(4)
  26.  
  27.  
  28. class ICustomButton : public IButton {
  29. typedef IButton
  30.   Inherited;
  31. public:
  32. class Style;
  33. /*------------------------------- Constructors -------------------------------*/
  34.   ICustomButton  ( unsigned long     id,
  35.                    IWindow*          parent,
  36.                    IWindow*          owner,
  37.                    const IRectangle& initial = IRectangle(),
  38.                    const Style&      style = defaultStyle() );
  39.  
  40.   ICustomButton ( const IWindowHandle& handle );
  41.  
  42. virtual
  43.   ~ICustomButton ( );
  44.  
  45. /*-------------------------------- Style -------------------------------------*/
  46. INESTEDBITFLAGCLASSDEF3(Style, ICustomButton, IWindow, IControl, IButton);
  47.  
  48. static const Style
  49.   IC_IMPORTU latchable,
  50.   IC_IMPORTU autoLatch,
  51.   IC_IMPORTU classDefaultStyle;
  52.  
  53. static Style
  54.   defaultStyle      ( );
  55.  
  56. static void
  57.   setDefaultStyle   ( const Style&    style );
  58.  
  59. virtual unsigned long
  60.   convertToGUIStyle ( const IBitFlag& style,
  61.                       Boolean         extendedOnly = false ) const;
  62.  
  63. /*------------------------------ Latch Support -------------------------------*/
  64. virtual ICustomButton
  65.  &enableLatching   ( Boolean enable = true ),
  66.  &disableLatching  ( ),
  67.  &enableAutoLatch  ( Boolean enable = true ),
  68.  &disableAutoLatch ( );
  69.  
  70. virtual Boolean
  71.   isLatchingEnabled  ( ) const,
  72.   isAutoLatchEnabled ( ) const;
  73.  
  74. virtual ICustomButton
  75.  &latch        ( Boolean latched = true,
  76.                  Boolean refresh = true ),
  77.  &unlatch      ( );
  78.  
  79. virtual Boolean
  80.   isLatched    ( ) const;
  81.  
  82. /*-------------------------------- Colors ------------------------------------*/
  83. virtual IColor
  84.   backgroundColor                  ( ) const,
  85.   latchedForegroundColor           ( ) const,
  86.   latchedBackgroundColor           ( ) const;
  87.  
  88. virtual ICustomButton
  89.   &setLatchedForegroundColor       ( const IColor& color ),
  90.   &setLatchedBackgroundColor       ( const IColor& color,
  91.                                      Boolean       halftone = true ),
  92.   &resetLatchedForegroundColor     ( ),
  93.   &resetLatchedBackgroundColor     ( );
  94.  
  95. virtual Boolean
  96.   isLatchedBackgroundColorHalftone ( ) const;
  97.  
  98. /*------------------------- Notification Members -----------------------------*/
  99. static INotificationId const
  100.   IC_IMPORTU latchId;
  101.  
  102. /*------------------------------- User Data ----------------------------------*/
  103. unsigned long
  104.   userData ( ) const;
  105.  
  106. ICustomButton
  107.   &setUserData ( unsigned long data );
  108.  
  109. protected:
  110. /*----------------------------- Layout Support -------------------------------*/
  111. virtual ISize
  112.   calcMinimumSize ( ) const;
  113.  
  114. /*------------------------- Constructors -------------------------------------*/
  115.   ICustomButton ( );
  116.  
  117. private:
  118. /*--------------------------------- Private ----------------------------------*/
  119. /*--------------------------- Hidden Members ---------------------------------*/
  120.   ICustomButton             ( const ICustomButton& );
  121.   ICustomButton& operator = ( const ICustomButton& );
  122. static Style
  123.   fgCurrentDefaultStyle;
  124. ICustomButtonData
  125.  *fCustomButtonData;
  126. void
  127.   checkAutoLatch ( );
  128. };
  129.  
  130. INESTEDBITFLAGCLASSFUNCS(Style, ICustomButton);
  131.  
  132.  
  133. #pragma pack()
  134.  
  135. #endif /* _ICUSTBUT_ */
  136.