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

  1. #ifndef _ISIZEHDR_
  2.   #define _ISIZEHDR_
  3. /*******************************************************************************
  4. * FILE NAME: isizehdr.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IResizeHandler - Process a resizing event for a window/control.          *
  9. *                                                                              *
  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:   S:/ibmclass/ibaseapp/vcs/isizehdr.hpv  $                                                                         *
  19. // 
  20. //    Rev 1.21   26 Oct 1992 00:36:12   tsuji
  21. // Format/document in the style of the standard header file.
  22. *******************************************************************************/
  23. #ifndef _IHANDLER_
  24.   #include <ihandler.hpp>
  25. #endif
  26.  
  27. // Forward declarations for other classes:
  28. class IResizeHandler;  /* szh */
  29. class IResizeEvent;
  30. class IEvent;
  31.  
  32. class IResizeHandler : public IHandler {
  33. /*******************************************************************************
  34. * This class handles processing of resizing events for all windows and         *
  35. * controls.                                                                    *
  36. *                                                                              *
  37. * The IResizeHandler class is designed to handle resizing events, which grow   *
  38. * or shrink a window or control on the screen.  If registered to a window or   *
  39. * control (by being passed on a call to its addHandler() function), the        *
  40. * IResizeHandler object will be called to process the resizing event.  It does *
  41. * this by creating an IResizeEvent object and routing it to the virtual        *
  42. * virtual windowResize() function (this virtual function allows you to supply  *
  43. * your own specialized processing of the event).  The return value from the    *
  44. * virtual function specifies if the IResizeEvent should be passed on to        *
  45. * another handler object to be processed, as described below:                  *
  46. *                                                                              *
  47. *   Value  Meaning                                                             *
  48. *   ------ --------                                                            *
  49. *   true   The IResizeEvent has been handled and requires no additional        *
  50. *          processing.                                                         *
  51. *   false  The IResizeEvent should be passed to the next handler (if this is   *
  52. *          the last handler for the window or control it should be passed on   *
  53. *          to the default window procedure).                                   *
  54. *                                                                              *
  55. * EXAMPLE:                                                                     *
  56. *   MyWindow::MyWindow()                                                       *
  57. *     : ...                                                                    *
  58. *   {                                                                          *
  59. *     MyResizeHandler* szh = new MyResizeHandler();                            *
  60. *     ...                                                                      *
  61. *     addHandler(szh);                                                         *
  62. *     ...                                                                      *
  63. *     show();                                                                  *
  64. *   }                                                                          *
  65. *   Boolean  MyResizeHandler::windowResize(IResizeEvent& evt)                  *
  66. *   {                                                                          *
  67. *     // Specialized processing here.                                          *
  68. *     ...                                                                      *
  69. *     return true;                                                             *
  70. *   }                                                                          *
  71. *******************************************************************************/
  72. typedef IHandler Inherited;
  73. public:
  74. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  75. | There is 1 way to construct instances of this class:                         |
  76. |   1. default constructor                                                     |
  77. ------------------------------------------------------------------------------*/
  78.   IResizeHandler ( ) {;}
  79.  
  80. /*----------------------- EVENT DISPATCHING INTERFACE --------------------------
  81. | This function evaluates the event to determine if it is one appropriate for  |
  82. | this handler object to process.  If so it calls the virtual function used to |
  83. | process the event.                                                           |
  84. |   dispatchHandlerEvent - invokes the windowResize function if size event     |
  85. ------------------------------------------------------------------------------*/
  86. Boolean
  87.   dispatchHandlerEvent ( IEvent& evt );
  88.  
  89. protected:
  90. /*------------------------ EVENT PROCESSING FUNCTIONS --------------------------
  91. | This function must be supplied by a derived class in order to provide        |
  92. | processing for a resizing event.                                             |
  93. |   windowResize - function used to process the resizing event                 |
  94. ------------------------------------------------------------------------------*/
  95. virtual Boolean
  96.   windowResize         ( IResizeEvent& evt ) = 0;
  97. };
  98. #endif /* ISIZEHDR */
  99.