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

  1. #ifndef _IOUTLBOX_
  2.   #define _IOUTLBOX_
  3. /*******************************************************************************
  4. * FILE NAME: ioutlbox.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     Ioutlbox - This class creates and manages an unfilled rectangle 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/IOUTLBOX.HPV  $
  18. //
  19. //   Rev 1.6   25 Oct 1992 17:05:44   nunn
  20. //changed library name to ICLUI
  21. //
  22. //   Rev 1.5   25 Oct 1992 10:55:48   boezeman
  23. //Add documentation and converted file to skeleton.hpp format.
  24.  
  25.       Rev 1.4   13 Oct 1992 21:22:22   tsuji
  26.    Correct comments around log directive.
  27.  
  28.       Rev 1.3   13 Oct 1992 20:57:08   tsuji
  29.    Correct log directive, remove IBM Confidential classification.
  30.  
  31.       Rev 1.2   13 Oct 1992 19:05:58   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 IOutlineBox;  /* olbx */
  40. class IRectangle;
  41. class ISize;
  42. class IWindowHandle;
  43. #ifndef _IBITFLAG_
  44.   #include <ibitflag.hpp>
  45. #endif
  46.  
  47. class IOutlineBox : public IControl  {
  48. /*******************************************************************************
  49. * This class creates and manages an unfilled rectangle control.                *
  50. *                                                                              *
  51. * To use this class, create an outline box control window with the current     *
  52. * background, current foreground, or halftone pattern in the current           *
  53. * foreground color, as follows:                                                *
  54. *   IOutlineBox olbx(ID_BKGNDRECT, this, IRectangle(10,10,110,210));           *
  55. *                                                                              *
  56. *   IOutlineBox olbx(ID_BKGNDRECT, this, IRectangle(10,10,110,210),            *
  57. *                   WS_VISIBLE | SS_FGNDFRAME);                                *
  58. *                                                                              *
  59. *  IOutlineBox olbx(ID_BKGNDRECT, this, IRectangle(10,10,110,210),             *
  60. *                   WS_VISIBLE | SS_HALFTONEFRAME);                            *
  61. *                                                                              *
  62. * Valid styles for an outline box are:                                         *
  63. *   IOutlineBox::foreground,                                                   *
  64. *   IOutlineBox::background,                                                   *
  65. *   IOutlineBox::halftone,                                                     *
  66. *   IOutlineBox::defStyle, and any of the IWindow styles.                      *
  67. *                                                                              *
  68. * EXAMPLE:                                                                     *
  69. *   <sample code>                                                              *
  70. *******************************************************************************/
  71. typedef IControl
  72.   Inherited;
  73. public:
  74. INESTEDBITFLAGCLASSDEF1(Style, IOutlineBox, IWindow);
  75.                                   // style class definition
  76. static const Style&
  77.   defStyle;
  78.  
  79. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  80. | There are 3 ways to construct instances of this class:                       |
  81. |   1. default                                                                 |
  82. |   2. From a Dialog Template                                                  |
  83. |   3. From a Window                                                           |
  84. ------------------------------------------------------------------------------*/
  85.   IOutlineBox(unsigned long Id,
  86.               const IWindow* parent,
  87.               const IWindow* owner,
  88.               const IRectangle& initial,
  89.               Style style = defStyle);
  90.  
  91.   IOutlineBox(unsigned long Id,
  92.               const IWindow* parentDialog);
  93.  
  94.   IOutlineBox(IWindowHandle handle);
  95.  
  96. /*-------------------------------- STYLES --------------------------------------
  97. | These function provide means of getting and setting the default style        |
  98. | attributes of instances of this class:                                       |
  99. |   defaultStyle    - returns the outline box control default style setting    |
  100. |   setDefaultStyle - sets the outline box control default style               |
  101. ------------------------------------------------------------------------------*/
  102. static Style
  103.    defaultStyle();
  104. static void
  105.    setDefaultStyle(Style style);
  106.  
  107. /*-------------------------------- FILLTYPE ------------------------------------
  108. | This function sets how the rectangle is drawn.                               |
  109. |   setOutlineType  -  takes one of the following inputs:                      |
  110. |          foreground  - for foreground color                                  |
  111. |          background  - for background color (default if function not called) |
  112. |          halftone    - for halftone shading in the foreground color          |
  113. ------------------------------------------------------------------------------*/
  114. enum OutlineType { foreground, background, halftone };
  115. void
  116.   setOutlineType(OutlineType type);
  117.  
  118. protected:
  119. /*----------------------------- LAYOUT SIZE ------------------------------------
  120. | calcMinSize - returns the minimum size that this outline box control should be|
  121. ------------------------------------------------------------------------------*/
  122. virtual ISize
  123.   calcMinSize();
  124.  
  125. static Style
  126.   classDefaultStyle;
  127.  
  128. private:
  129. /*--------------------------------- PRIVATE ----------------------------------*/
  130.   IOutlineBox(const IOutlineBox&);
  131. //IOutlineBox& operator=(const IOutlineBox&);
  132.  
  133. static const Style
  134.   backgroundFrame,
  135.   foregroundFrame,
  136.   halftoneFrame,
  137.   defaultFrame,
  138.   allFrames;
  139. };  // class IOutlineBox
  140.  
  141. INESTEDBITFLAGCLASSFUNCS(Style, IOutlineBox);
  142.                                   // global style functions
  143. #endif  // _IOUTLBOX_
  144.