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

  1. #ifndef _IPUSHBUT_
  2.   #define _IPUSHBUT_
  3. /*******************************************************************************
  4. * FILE NAME: ipushbut.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IPushButton                                                              *
  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.  
  21. class ISize;
  22. class IWindowHandle;
  23. class IPushButtonData;
  24.  
  25. #pragma pack(4)
  26.  
  27. class IPushButton : public IButton  {
  28. typedef IButton
  29.   Inherited;
  30. public:
  31.  
  32. class Style;
  33.  
  34. /*------------------------------- Constructors -------------------------------*/
  35.   IPushButton ( unsigned long id,
  36.                 IWindow* parent,
  37.                 IWindow* owner,
  38.                 const IRectangle& initial= IRectangle(),
  39.                 const Style& style = defaultStyle() );
  40.  
  41.   IPushButton ( unsigned long id,
  42.                 IWindow*      parent );
  43.  
  44.   IPushButton ( const IWindowHandle& handle );
  45.  
  46. virtual
  47.  ~IPushButton ( );
  48.  
  49. /*---------------------------------- Styles ----------------------------------*/
  50. INESTEDBITFLAGCLASSDEF3( Style,
  51.                          IPushButton,
  52.                          IWindow,
  53.                          IControl,
  54.                          IButton );
  55.  
  56. static const Style
  57.   IC_IMPORTU classDefaultStyle,
  58.   IC_IMPORTU help,
  59.   IC_IMPORTU systemCommand,
  60. #ifndef IC_WIN_FLAGNOP
  61.   IC_IMPORTU noBorder,
  62. #endif
  63.   IC_IMPORTU defaultButton;
  64.  
  65. static Style
  66.   defaultStyle      ( );
  67.  
  68. static void
  69.   setDefaultStyle   ( const Style&    style );
  70.  
  71. virtual unsigned long
  72.   convertToGUIStyle ( const IBitFlag& style,
  73.                       Boolean         extendedOnly = false ) const;
  74.  
  75. /*----------------------------- Style Functions ------------------------------*/
  76. Boolean
  77.   isDefault            ( ) const,
  78.   isHelp               ( ) const,
  79. #ifndef IC_WIN_FLAGNOP
  80.   hasBorder            ( ) const,
  81. #endif
  82.   isSystemCommand      ( ) const;
  83.  
  84. virtual IPushButton
  85.  &enableDefault        ( Boolean enable = true ),
  86.  &disableDefault       ( ),
  87.  &enableHelp           ( Boolean enable = true ),
  88.  &disableHelp          ( ),
  89. #ifndef IC_WIN_FLAGNOP
  90.  &addBorder            ( Boolean add    = true ),
  91.  &removeBorder         ( ),
  92. #endif
  93.  &enableSystemCommand  ( Boolean enable = true ),
  94.  &disableSystemCommand ( );
  95.  
  96. protected:
  97.  
  98. /*-------------------------- Protected Constructors --------------------------*/
  99.  
  100. /*---------------------------------- Layout ----------------------------------*/
  101. virtual ISize
  102.   calcMinimumSize      ( ) const;
  103.  
  104. /*---------------------- Event Handling Implementation -----------------------*/
  105.  
  106. private:
  107. /*--------------------------------- Private ----------------------------------*/
  108. static Style
  109.   currentDefaultStyle;
  110.  
  111. IPushButtonData
  112.  *fPushButtonData;
  113.  
  114.  
  115. /*----------------------------- Hidden Functions -----------------------------*/
  116.   IPushButton          ( const IPushButton& );
  117. IPushButton
  118.  &operator=            ( const IPushButton& );
  119.  
  120. };  // class IPushButton
  121.  
  122. INESTEDBITFLAGCLASSFUNCS ( Style, IPushButton );
  123.  
  124. #pragma pack()
  125.  
  126. #endif  // _IPUSHBUT_
  127.