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

  1. #ifndef _IICONCTL_
  2.   #define _IICONCTL_
  3. /*******************************************************************************
  4. * FILE NAME: iiconctl.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *    IIconControl                                                              *
  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 <ibmpctl.hpp>
  19. #include <irect.hpp>
  20.  
  21. class IPointerHandle;
  22. class IResourceId;
  23. class ISize;
  24. class IWindowHandle;
  25. class IIconControlData;
  26.  
  27. #pragma pack(4)
  28.  
  29. class IIconControl : public IBitmapControl  {
  30. typedef IBitmapControl
  31.   Inherited;
  32. public:
  33. class Style;
  34. /*------------------------ Constructors --------------------------------------*/
  35.   IIconControl(unsigned long id,
  36.                IWindow* parent,
  37.                IWindow* owner,
  38.                const IResourceId& iconId,
  39.                const IRectangle& initial= IRectangle(),
  40.                const Style& style = defaultStyle() );
  41.  
  42.   IIconControl(unsigned long id,
  43.                IWindow* parent,
  44.                IWindow* owner,
  45.                unsigned long iconId,
  46.                const IRectangle& initial= IRectangle(),
  47.                const Style& style = defaultStyle() );
  48.  
  49.   IIconControl(unsigned long id,
  50.                IWindow* parent,
  51.                IWindow* owner,
  52.                const IPointerHandle& iconId = IPointerHandle(),
  53.                const IRectangle& initial= IRectangle(),
  54.                const Style& style = defaultStyle() );
  55.  
  56.   IIconControl(unsigned long id,
  57.                IWindow* parent,
  58.                IWindow* owner,
  59.                ISystemPointerHandle::Identifier icon,
  60.                const IRectangle& initial= IRectangle(),
  61.                const Style& style = defaultStyle() );
  62.  
  63.   IIconControl(unsigned long id,
  64.                IWindow* parentDialog);
  65.  
  66.   IIconControl(const IWindowHandle& handle);
  67.  
  68. virtual
  69.   ~IIconControl();
  70.  
  71. /*---------------------------------- Styles  ---------------------------------*/
  72. INESTEDBITFLAGCLASSDEF3(Style, IIconControl, IWindow, IControl, IStaticText);
  73.                                // style class definition
  74.  
  75. static const Style
  76.   IC_IMPORTU classDefaultStyle,
  77.   IC_IMPORTU sizeToIcon;
  78.  
  79. static Style
  80.   defaultStyle      ( );
  81.  
  82. static void
  83.   setDefaultStyle   ( const Style&    style );
  84.  
  85. virtual unsigned long
  86.   convertToGUIStyle ( const IBitFlag& style,
  87.                       Boolean         extendedOnly = false ) const;
  88.  
  89. /*------------------------------- Icons --------------------------------------*/
  90. virtual IIconControl
  91.   &setIcon(unsigned long iconId),
  92.   &setIcon(const IResourceId&  iconId),
  93.   &setIcon(const IPointerHandle& handle);
  94.  
  95. virtual IIconControl
  96.   &setIcon(ISystemPointerHandle::Identifier icon);
  97.  
  98. IPointerHandle
  99.   icon() const;
  100.  
  101.  
  102. /*---------------------------- Canvas Support --------------------------------*/
  103. virtual IRectangle
  104.   visibleRectangle   ( ) const;
  105.  
  106. protected:
  107. /*----------------------------- Layout Support -------------------------------*/
  108. virtual ISize
  109.   calcMinimumSize() const;
  110.  
  111. private:
  112. /*--------------------------------- Private ----------------------------------*/
  113.  
  114. static Style
  115.   currentDefaultStyle;
  116.  
  117. IIconControlData
  118.  *fIconControlData;
  119.  
  120. IIconControl
  121.   &initialize(const Style& style);
  122.  
  123. IPointerHandle
  124.   iconHandle;
  125. Boolean
  126.   bSizeTo,
  127.   returnback,
  128.   bHalf;
  129. friend class IIconHandler;
  130.  
  131. /*----------------------------- Hidden Functions -----------------------------*/
  132.   IIconControl(const IIconControl&);
  133.   IIconControl& operator=(const IIconControl&);
  134. };  // class IIconControl
  135.  
  136. INESTEDBITFLAGCLASSFUNCS(Style, IIconControl);
  137.                                   // global style functions
  138.  
  139. #pragma pack()
  140.  
  141. #endif  /* _IICONCTL_ */
  142.