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

  1. #ifndef _ICNRDIHD_
  2.   #define _ICNRDIHD_
  3. /*******************************************************************************
  4. * FILE NAME: icnrdihd.h                                                        *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   ICnrDrawHandler                                                            *
  8. *                                                                              *
  9. * COPYRIGHT:                                                                   *
  10. *   Licensed Materials - Property of IBM                                       *
  11. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  12. *   All Rights Reserved                                                        *
  13. *   US Government Users Restricted Rights - Use, duplication, or               *
  14. *   disclosure                                                                 *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #ifndef _IHANDLER_
  19.   #include <ihandler.hpp>
  20. #endif
  21.  
  22. #ifndef _ICNRDIEV_
  23.   #include <icnrdiev.hpp>
  24. #endif
  25.  
  26. /*----------------------------------------------------------------------------*/
  27. /* Align classes on four byte boundary.                                       */
  28. /*----------------------------------------------------------------------------*/
  29. #pragma pack(4)
  30.  
  31. class IControl;
  32. class IContainerControl;
  33.  
  34. class ICnrDrawHandler : public IHandler
  35. {
  36. typedef IHandler
  37.   Inherited;
  38. /*******************************************************************************
  39. * The ICnrDrawHandler class provides the notification of draw item and draw    *
  40. * background events in the container.                                          *
  41. *                                                                              *
  42. * In order for draw item events to be dispatched, the                          *
  43. * IContainerControl::drawItem style must be specified on construction of the   *
  44. * container or the IContainerControl::enableDrawItem function must be called   *
  45. * after the container is constructed.                                          *
  46. *                                                                              *
  47. * Similarly, for draw background events to be dispatched, the                  *
  48. * IContainerControl::drawBackground style must be specified on construction    *
  49. * of the container or the IContainerControl::enableDrawBackground function     *
  50. * must be called after the container is constructed.                           *
  51. *                                                                              *
  52. * In addition, whenever the application draws a container item or background,  *
  53. * it should call IEvent::setResult(true) so that the system knows not to do    *
  54. * the drawing.                                                                 *
  55. *******************************************************************************/
  56. public:
  57. /*------------------------ Constructors ----------------------------------------
  58. | The only way to construct an instance of this class is to use the default    |
  59. | constructor.                                                                 |
  60. ------------------------------------------------------------------------------*/
  61.   ICnrDrawHandler   ( );
  62.  ~ICnrDrawHandler   ( );
  63.  
  64. /*------------------------ Event Processing ------------------------------------
  65. | These functions must be supplied by a derived class in order to provide      |
  66. | processing for a draw event:                                                 |
  67. |   drawText        - Called when the text in the icon, name, or text view     |
  68. |                     needs to be redrawn.  The emphasis of the text must be   |
  69. |                     drawn during the processing of this event.               |
  70. |   drawIcon        - Called when the icon in the icon or name view needs to   |
  71. |                     be redrawn.  The emphasis of the icon must be drawn      |
  72. |                     during the processing of this event.                     |
  73. |   drawTreeIcon    - Called in the tree view when the expanded or collapsed   |
  74. |                     icon needs to be redrawn.                                |
  75. |   drawDetailsItem - Called in the details view when the data of an object    |
  76. |                     in a column needs to be redrawn.  The emphasis of the    |
  77. |                     data must be drawn during the processing of this event.  |
  78. |   drawTitle       - Called when the title of the container needs to be       |
  79. |                     redrawn.                                                 |
  80. |   drawBackground  - Called when the background of the container needs to be  |
  81. |                     redrawn.                                                 |
  82. ------------------------------------------------------------------------------*/
  83. virtual Boolean
  84.   drawText          ( ICnrDrawItemEvent&       event),
  85.   drawIcon          ( ICnrDrawItemEvent&       event),
  86.   drawTreeIcon      ( ICnrDrawItemEvent&       event),
  87.   drawDetailsItem   ( ICnrDrawItemEvent&       event),
  88.   drawTitle         ( ICnrDrawItemEvent&       event),
  89.   drawBackground    ( ICnrDrawBackgroundEvent& event);
  90.  
  91.  
  92. /*---------------------------- Window Attachment -------------------------------
  93. | These functions permit attaching and detaching the handler object to and     |
  94. | from a container window:                                                     |
  95. |   handleEventsFor       - Attaches the handler to the container control      |
  96. |                           passed in the argument.                            |
  97. |   stopHandlingEventsFor - Detaches the handler from the container control    |
  98. |                           passed in the argument.                            |
  99. ------------------------------------------------------------------------------*/
  100. virtual ICnrDrawHandler
  101.  &handleEventsFor       ( IContainerControl* container ),
  102.  &stopHandlingEventsFor ( IContainerControl* container );
  103.  
  104.  
  105. protected:
  106. /*----------------------------- Implementation ---------------------------------
  107. | This function is used to implement the class:                                |
  108. |   dispatchHandlerEvent - Routes the draw events to the appropriate event     |
  109. |                          functions.                                          |
  110. ------------------------------------------------------------------------------*/
  111. virtual Boolean
  112.   dispatchHandlerEvent ( IEvent& event);
  113.  
  114. private:
  115.  
  116. /* Hidden functions */
  117. virtual IHandler
  118.  &handleEventsFor       ( IWindow* window  ),
  119.  &stopHandlingEventsFor ( IWindow* window  );
  120.  
  121. };
  122.  
  123. /*----------------------------------------------------------------------------*/
  124. /* Resume compiler default packing.                                           */
  125. /*----------------------------------------------------------------------------*/
  126. #pragma pack()
  127.  
  128. #endif
  129.