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

  1. #ifndef _ICONTROL_
  2.   #define _ICONTROL_
  3. /*******************************************************************************
  4. * FILE NAME: Icontrol.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    Icontrol - This is the abstract pure virtual base class for all control   *
  9. *               view windows.                                                  *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   Licensed Materials - Property of IBM                                       *
  13. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  14. *   All Rights Reserved                                                        *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. * $Log:   R:/IBMCLASS/IBASECTL/VCS/ICONTROL.HPV  $
  19. //
  20. //   Rev 1.5   25 Oct 1992 17:05:14   nunn
  21. //changed library name to ICLUI
  22. //
  23. //   Rev 1.4   25 Oct 1992 10:53:14   boezeman
  24. //Add documentation and converted file to skeleton.hpp format.
  25.  
  26.       Rev 1.1   12 Aug 1992 21:22:06   KKL
  27.    For IBMCPP.
  28. *******************************************************************************/
  29. #ifndef _IWINDOW_
  30.   #include <iwindow.hpp>
  31. #endif
  32.  
  33. // Forward declarations for other classes:
  34. class IControl;
  35. class IFontMgr;
  36. #ifndef _IHANDLE_
  37.   #include <ihandle.hpp>
  38. #endif
  39. #ifndef _IPOINT_
  40.   #include <ipoint.hpp>
  41. #endif
  42.  
  43. class IControl : public IWindow  {
  44. /*******************************************************************************
  45. *    This is the abstract pure virtual base class for control                  *
  46. *    view windows.                                                             *
  47. * EXAMPLE:                                                                     *
  48. *   <sample code>                                                              *
  49. *******************************************************************************/
  50. typedef IControl
  51.   Inherited;
  52.  
  53. public:
  54. INESTEDBITFLAGCLASSDEF1(Style, IControl, IWindow);
  55. static const Style
  56.   group,
  57.   tabstop;
  58. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  59. | There is 1 way to construct instances of this class:                         |
  60. |   1. default                                                                 |
  61. ------------------------------------------------------------------------------*/
  62.   IControl();
  63. //IControl(IWindowHandle wndh);
  64. virtual
  65.   ~IControl() {;}
  66.  
  67.  
  68. /*----------------------------- LAYOUT SIZE ------------------------------------
  69. | This operation returns the minimum size for the check box control.           |
  70. |   calcMinSize - Virtual function returning the minimun allowable size of     |
  71. |                 the window, used by canvas layout routined. Default          |
  72. |                 operation returns the minimun size set by users. Typically,  |
  73. |                 this should calculate the minimun size based on text and     |
  74. |                 current font setting.                                        |
  75. |   setMinSize  - Set the minimun allowable size of the window. In the library |
  76. |                 this only apply to window on a canvas.                       |
  77. |   minSize     - Returns the minimun allowable size set by the user's class   |
  78. ------------------------------------------------------------------------------*/
  79. virtual ISize
  80.   calcMinSize();
  81. void
  82.   setMinSize(const ISize& sizMin);
  83. const ISize&
  84.   minSize() const;
  85.  
  86. //virtual void setFont(IFontMgr& fm);
  87.  
  88. //void clearBackground();
  89. //void clearBackground(const IRectangle& rect);
  90.  
  91. private:
  92. /*--------------------------------- PRIVATE ----------------------------------*/
  93.   IControl(const IControl&);
  94.   IControl& operator=(const IControl&);
  95.  
  96. ISize
  97.   sizClMin;
  98. };  // class IControl
  99.  
  100. INESTEDBITFLAGCLASSFUNCS(Style, IControl);
  101.                                   // global style functions
  102.  
  103. /*--------------------------------- INLINES ----------------------------------*/
  104. inline IControl::IControl()
  105. /**************************************************************/
  106. /* Default constructor.                                       */
  107. /**************************************************************/
  108.   : sizClMin(100,100), IWindow()
  109. {;}
  110.  
  111. //inline IControl::IControl(IWindowHandle wndh)
  112. /**************************************************************/
  113. /* Constructor.                                               */
  114. /**************************************************************/
  115. //  : sizClMin(100,100), IWindow(wndh)
  116. //{;}
  117.  
  118. inline void IControl::setMinSize(const ISize& sizMin)
  119. /**************************************************************/
  120. /* Set the minimun allowable size of the window. In the       */
  121. /* library this only apply to window on a canvas.             */
  122. /**************************************************************/
  123. { sizClMin = sizMin; }
  124.  
  125. inline const ISize& IControl::minSize() const
  126. /**************************************************************/
  127. /* Returns the minimun allowable size set by the user's class */
  128. /**************************************************************/
  129. { return sizClMin; }
  130. #endif  /* _ICONTROL_ */
  131.