home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / iiconctl.hp_ / IICONCTL.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  6.2 KB  |  153 lines

  1. #ifndef _IICONCTL_
  2.   #define _IICONCTL_
  3. /*******************************************************************************
  4. * FILE NAME: Iiconctl.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    Iiconctl - This class creates and manages an icon control.                *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   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. * $Log:   R:/IBMCLASS/IBASECTL/VCS/IICONCTL.HPV  $
  18. //
  19. //   Rev 1.8   25 Oct 1992 17:05:30   nunn
  20. //changed library name to ICLUI
  21. //
  22. //   Rev 1.7   25 Oct 1992 10:54:46   boezeman
  23. //Add documentation and converted file to skeleton.hpp format.
  24.  
  25.       Rev 1.6   13 Oct 1992 21:22:16   tsuji
  26.    Correct comments around log directive.
  27.  
  28.       Rev 1.5   13 Oct 1992 20:57:00   tsuji
  29.    Correct log directive, remove IBM Confidential classification.
  30.  
  31.       Rev 1.4   13 Oct 1992 19:05:54   tsuji
  32.    Remove no-op virtual destructor, add Inherited typedef.
  33. *******************************************************************************/
  34. #ifndef _ICONTROL_
  35.   #include <icontrol.hpp>
  36. #endif
  37.  
  38. // Forward declarations for other classes:
  39. class IIconControl;  /* ic */
  40. class IPointerHandle;
  41. class IRectangle;
  42. class IResourceId;
  43. class ISize;
  44. class IWindowHandle;
  45. #ifndef _IBITFLAG_
  46.   #include <ibitflag.hpp>
  47. #endif
  48.  
  49. class IIconControl : public IControl  {
  50. /*******************************************************************************
  51. *    This class creates and operates on an icon control.                       *
  52. * EXAMPLE:                                                                     *
  53. *   <sample code>                                                              *
  54. *******************************************************************************/
  55. typedef IControl
  56.   Inherited;
  57.  
  58. public:
  59. INESTEDBITFLAGCLASSDEF1(Style, IIconControl, IWindow);
  60.                                // style class definition
  61. static const Style
  62.   autosize;
  63. static const Style&
  64.   defStyle;
  65. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  66. | There are 4 ways to construct instances of this class:                       |
  67. |   1. default                                                                 |
  68. |   2. From a System Icon                                                      |
  69. |   3. From a Dialog Template                                                  |
  70. |   4. From a Window                                                           |
  71. ------------------------------------------------------------------------------*/
  72.   IIconControl(unsigned long Id,
  73.                const IWindow* parent,
  74.                const IWindow* owner,
  75.                const IRectangle& initial,
  76.                const IResourceId& iconId,
  77.                Style style = defStyle);
  78.  
  79.   IIconControl(unsigned long Id,
  80.                const IWindow* parent,
  81.                const IWindow* owner,
  82.                const IRectangle& initial,
  83.                ISysPointerHandle::Type icon,
  84.                Style style = defStyle);
  85.  
  86.   IIconControl(unsigned long Id,
  87.                const IWindow* parentDialog);
  88.  
  89.   IIconControl(IWindowHandle handle);
  90.  
  91. /*-------------------------------- STYLES --------------------------------------
  92. | These function provide means of getting and setting the default style        |
  93. | attributes of instances of this class:                                       |
  94. |   defaultStyle    - returns the icon control default style setting           |
  95. |   setDefaultStyle - sets the icon control default style                      |
  96. ------------------------------------------------------------------------------*/
  97. static Style
  98.   defaultStyle();
  99. static void
  100.   setDefaultStyle(Style style);
  101.  
  102. /*-------------------------------- QUERY/SET HANDLE ----------------------------
  103. | These operations return and change the icon image in an icon control window. |
  104. |   setIcon  - Sets the icon handle of the icon control window                 |
  105. |   icon     - Returns the handle of the currently set icon                    |
  106. ------------------------------------------------------------------------------*/
  107. void
  108.   setIcon(const IResourceId& iconId),
  109.   setIcon(IPointerHandle handle),
  110.   setIcon(ISysPointerHandle::Type icon),
  111.   setIcon(ISysPointerHandle handle);
  112. IPointerHandle
  113.   icon() const;
  114. /***********************************************************/
  115. /* Scaling of icon -- need to handle later?                */
  116. /* Also, repaint buffer does not work with icons -- can    */
  117. /* provide a solution here or in dispatch()?               */
  118. /***********************************************************/
  119.  
  120. protected:
  121. /*----------------------------- LAYOUT SIZE ------------------------------------
  122. | calcMinSize - returns the minimum size that this icon control should be.     |
  123. ------------------------------------------------------------------------------*/
  124. virtual ISize
  125.   calcMinSize();
  126.  
  127. static Style
  128.   classDefaultStyle;
  129.  
  130. private:
  131. /*--------------------------------- PRIVATE ----------------------------------*/
  132.   IIconControl(const IIconControl&);
  133. //IIconControl& operator=(const IIconControl&);
  134.  
  135. void
  136.   create(unsigned long Id,
  137.          const IWindow* parent,
  138.          const IWindow* owner,
  139.          const IRectangle& initial,
  140.          Style style);
  141.  
  142. static const Style
  143.   iconStyle,
  144.   systemIconStyle;
  145.  
  146. IPointerHandle
  147.   iconHandle;
  148. };  // class IIconControl
  149.  
  150. INESTEDBITFLAGCLASSFUNCS(Style, IIconControl);
  151.                                   // global style functions
  152. #endif  /* _IICONCTL_ */
  153.