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

  1. #ifndef _ISLIDHDR_
  2.   #define _ISLIDHDR_
  3. /*******************************************************************************
  4. * FILE NAME: islidhdr.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     ISliderDrawHandler - The slider draw-item handler class.                 *
  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 _IHANDLER_
  19.   #include <ihandler.hpp>
  20. #endif
  21. #ifndef _IDIEVT_
  22.   #include <idievt.hpp>
  23. #endif
  24.  
  25. /*----------------------------------------------------------------------------*/
  26. /* Align classes on four byte boundary.                                       */
  27. /*----------------------------------------------------------------------------*/
  28. #pragma pack(4)
  29.  
  30. // Forward declarations for other classes:
  31.  
  32.  
  33. class ISliderDrawHandler : public IHandler {
  34. typedef IHandler
  35.   Inherited;
  36. /*******************************************************************************
  37. * The ISliderDrawHandler class is used to draw slider and progress indicator   *
  38. * control objects.  You can draw the:                                          *
  39. *   - Slider shaft                                                             *
  40. *   - Ribbon strip                                                             *
  41. *   - Slider arm                                                               *
  42. *   - Slider background                                                        *
  43. *                                                                              *
  44. * The slider or progress indicator must be created with the handleDrawItem     *
  45. * style specified or must set this style using the                             *
  46. * IProgressIndicator::enableDrawItem member function.                          *
  47. *                                                                              *
  48. * An ISliderDrawHandler object should be attached to the control (slider or    *
  49. * progress indicator) that generated the draw item event or to the owner       *
  50. * window of the control.  This is done by passing the control or the owner     *
  51. * window on the handleEventsFor function of the ISliderDrawHandler object.     *
  52. *                                                                              *
  53. * When it receives a draw item event, the ISliderDrawHandler object processes  *
  54. * the event by creating an IControlEvent object and routing it to the          *
  55. * appropriate virtual function.  You can override these virtual functions to   *
  56. * supply your own specialized processing of the event.  The return value from  *
  57. * the virtual function specifies whether the IControlEvent should be passed    *
  58. * on for additional processing, as follows:                                    *
  59. *                                                                              *
  60. *   Value   Meaning                                                            *
  61. *   ---------------                                                            *
  62. *   true  - The IControlEvent object requires no additional processing and     *
  63. *           should not be passed to another handler.                           *
  64. *   false - The IControlEvent object should be passed on for additional        *
  65. *           processing, as follows:                                            *
  66. *           -- If there is a next handler for the control or window, the       *
  67. *              event is passed on to the next handler.                         *
  68. *           -- If this is the last handler for the control, the event is       *
  69. *              dispatched to the owner window of the control                   *
  70. *              (see IWindow::dispatch).                                        *
  71. *           -- If this is the last handler for the owner window, the event is  *
  72. *              passed on a call to the owner window's defaultProcedure         *
  73. *              function (see IWindow::defaultProcedure).                       *
  74. *******************************************************************************/
  75. public:
  76. /*-------------------------- Constructor/Destructor ----------------------------
  77. | The only way to construct instances of this class is to use the default      |
  78. | constructor.                                                                 |
  79. ------------------------------------------------------------------------------*/
  80.   ISliderDrawHandler   ( );
  81.  
  82. virtual
  83.  ~ISliderDrawHandler   ( );
  84.  
  85. protected:
  86. /*--------------------------- Command Dispatching ------------------------------
  87. | This function evaluates the event to determine if it is appropriate for      |
  88. | this handler object to process.  If it is, this function calls the virtual   |
  89. | function used to process the event.                                          |
  90. |   dispatchHandlerEvent - Calls the appropriate virtual function to process   |
  91. |                          a draw item event.                                  |
  92. ------------------------------------------------------------------------------*/
  93. virtual Boolean
  94.   dispatchHandlerEvent ( IEvent& event );
  95.  
  96. /*------------------------- Event Handling Functions ---------------------------
  97. | The following event handling functions are invoked by this handler when the  |
  98. | slider or progress indicator is to be painted.  You should override these    |
  99. | functions to provide the appropriate behavior for a derived class.  These    |
  100. | functions are expected to return true if the item has been drawn.  If false  |
  101. | is returned, the item has not been drawn and the slider control draws it.    |
  102. | The default behavior of these functions is to return false.                  |
  103. |   drawShaft        - The application overrides this function to handle       |
  104. |                      drawing the slider's shaft.                             |
  105. |   drawRibbonStrip  - The application overrides this function to handle       |
  106. |                      drawing the slider's ribbon strip.                      |
  107. |   drawArm          - The application overrides this function to handle       |
  108. |                      drawing the slider's arm.                               |
  109. |   drawBackground   - The application overrides this function to handle       |
  110. |                      drawing the slider's background.                        |
  111. ------------------------------------------------------------------------------*/
  112. virtual Boolean
  113.   drawShaft            ( IDrawItemEvent& event ),
  114.   drawRibbonStrip      ( IDrawItemEvent& event ),
  115.   drawArm              ( IDrawItemEvent& event ),
  116.   drawBackground       ( IDrawItemEvent& event );
  117. };  // ISliderDrawHandler
  118.  
  119. /*----------------------------------------------------------------------------*/
  120. /* Resume compiler default packing.                                           */
  121. /*----------------------------------------------------------------------------*/
  122. #pragma pack()
  123.  
  124. #endif /* _ISLIDHDR_ */
  125.