home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IPAINEVT.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  5KB  |  108 lines

  1. #ifndef _IPAINEVT_
  2.   #define _IPAINEVT_
  3. /*******************************************************************************
  4. * FILE NAME: ipainevt.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IPaintEvent - Represents a window repaint event.                         *
  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. *******************************************************************************/
  18. #ifndef _IEVENT_
  19.   #include <ievent.hpp>
  20. #endif
  21.  
  22. // Forward declarations for other classes:
  23.  
  24. #ifndef _ICOLOR_
  25.   #include <icolor.hpp>
  26. #endif
  27. #ifndef _IHANDLE_
  28.   #include <ihandle.hpp>
  29. #endif
  30. #ifndef _IRECT_
  31.   #include <irect.hpp>
  32. #endif
  33.  
  34. /*----------------------------------------------------------------------------*/
  35. /* Align classes on four byte boundary.                                       */
  36. /*----------------------------------------------------------------------------*/
  37. #pragma pack(4)
  38.  
  39.  
  40. class IPaintEvent : public IEvent {
  41. typedef IEvent
  42.   Inherited;
  43. /*******************************************************************************
  44. * The IPaintEvent class represents a paint event, which requires a window or   *
  45. * control to update its appearance on the screen.  This event object is        *
  46. * created by an IPaintHandler object and passed to its virtual paintWindow     *
  47. * function for processing.  All window updates should be done using the        *
  48. * presentation space handle supplied by the IPaintEvent object.                *
  49. *******************************************************************************/
  50. public:
  51. /*------------------------- Constructors/Destructor ----------------------------
  52. | The only way to construct instances of this class is from an IEvent object.  |
  53. ------------------------------------------------------------------------------*/
  54.   IPaintEvent     ( IEvent& event );
  55. virtual
  56.  ~IPaintEvent     ( );
  57.  
  58. /*-------------------------------- Accessors -----------------------------------
  59. | These functions return information related to the paint event.               |
  60. |   presSpaceHandle - Returns the handle of the presentation space to use for  |
  61. |                     any drawing.                                             |
  62. |   rect            - Returns the screen rectangle for the portion of the      |
  63. |                     window that needs updating.                              |
  64. ------------------------------------------------------------------------------*/
  65. const IPresSpaceHandle
  66.  &presSpaceHandle ( ) const;
  67. const IRectangle
  68.  &rect            ( ) const;
  69.  
  70. /*--------------------------------- Painting -----------------------------------
  71. | These functions can be used to update a window's appearance on the screen.   |
  72. |   clearBackground - Clears the specified rectangle, filling it with the      |
  73. |                     specified color.  If no rectangle is specified, the      |
  74. |                     rectangle that needs updating is used.                   |
  75. |   drawText        - Draws the specified text, beginning at the specified     |
  76. |                     point, using the specified color for the text.           |
  77. ------------------------------------------------------------------------------*/
  78. IPaintEvent
  79.  &clearBackground ( const IColor& background =
  80.                                   IGUIColor(IGUIColor::desktopBgnd) ),
  81.  &clearBackground ( const IRectangle& fillRectangle,
  82.                     const IColor& background =
  83.                                   IGUIColor(IGUIColor::desktopBgnd) ),
  84.  &drawText        ( const char* text,
  85.                     const IPoint& atPoint,
  86.                     const IColor& textColor =
  87.                              IGUIColor(IGUIColor::windowStaticText) );
  88.  
  89. private:
  90. /*--------------------------------- Private ----------------------------------*/
  91. IPresSpaceHandle
  92.   hpsCl;
  93. IRectangle
  94.   rectCl;
  95. }; // IPaintEvent
  96.  
  97. /*----------------------------------------------------------------------------*/
  98. /* Resume compiler default packing.                                           */
  99. /*----------------------------------------------------------------------------*/
  100. #pragma pack()
  101.  
  102. /*----------------------------- Inline Functions -----------------------------*/
  103. #ifndef I_NO_INLINES
  104.   #include <ipainevt.inl>
  105. #endif
  106.  
  107. #endif /* _IPAINEVT_ */
  108.