home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / irecohdr.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.8 KB  |  104 lines

  1. #ifndef _IRECOHDR_
  2.   #define _IRECOHDR_
  3. /*******************************************************************************
  4. * FILE NAME: irecohdr.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IRecoordHandler                                                          *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - 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. #include <ihandler.hpp>
  19.  
  20. class IEvent;
  21. class IRectangle;
  22. class IWindow;
  23. class IWindowHandle;
  24. class IRecoordHandlerData;
  25.  
  26. #pragma pack(4)
  27.  
  28. class IRecoordHandler : public IHandler {
  29. typedef IHandler
  30.   Inherited;
  31. /*******************************************************************************
  32. * The IRecoordHandler class handles the notification that a window or control  *
  33. * is being resized.                                                            *
  34. *                                                                              *
  35. * A recoordination event notifies a window when the size and position of the   *
  36. * window's client area must be calculated.  This event is processed by this    *
  37. * handler to make any adjustments in child window coordinates which are        *
  38. * necessary due to the window size change.   This handler is distinct from     *
  39. * an IResizeHander in that it runs before the IResizeHander and processes      *
  40. * a different message.   The message handled by the IRecoordHandler is         *
  41. * WM_CALCVALIDRECTS/WM_NCCALCSIZE.                                             *
  42. * IRecoordHandler processes the resizing event by creating an IRecoordEvent    *
  43. * object and routing it to the virtual windowResize function.  This virtual    *
  44. * function allows you to supply your own specialized processing of the event.  *
  45. * The return value from the virtual function specifies whether the             *
  46. * IResizeEvent should be passed on for additional processing, as follows:      *
  47. *                                                                              *
  48. *   Value   Meaning                                                            *
  49. *   ---------------                                                            *
  50. *   true  - The IResizeEvent object has been handled and requires no           *
  51. *           additional processing.                                             *
  52. *   false - The IResizeEvent object should be passed to the next handler.  If  *
  53. *           the next handler is the last handler for the window or control,    *
  54. *           the event is passed on a call to the window or control's           *
  55. *           defaultProcedure function (see IWindow::defaultProcedure).         *
  56. *                                                                              *
  57. *******************************************************************************/
  58. public:
  59. /*-------------------------- Constructors/Destructor ---------------------------
  60. | The only way to create objects of this class is by using the default         |
  61. | constructor.                                                                 |
  62. ------------------------------------------------------------------------------*/
  63.   IRecoordHandler ( );
  64. virtual
  65.  ~IRecoordHandler ( );
  66.  
  67. /*------------------------------ Default Object --------------------------------
  68. |  defaultHandler - returns a pointer to the default object of this class      |
  69. ------------------------------------------------------------------------------*/
  70. static IRecoordHandler
  71.   *defaultHandler( );
  72.  
  73. protected:
  74. /*---------------------------- Event Dispatching -------------------------------
  75. | This function evaluates the event to determine if it is appropriate for      |
  76. | this handler object to process.  If it is, this function calls the virtual   |
  77. | function used to process the event.                                          |
  78. |   dispatchHandlerEvent - Calls the windowResize function if a resize event   |
  79. |                          is found.                                           |
  80. ------------------------------------------------------------------------------*/
  81. virtual Boolean
  82.   dispatchHandlerEvent ( IEvent& event );
  83.  
  84. /*----------------------------- Event Processing -------------------------------
  85. | Event processing functions are called when an event affecting recoordination |
  86. | occurs.                                                                      |
  87. |   windowSizeChanged - called when the event indicates that the size of       |
  88. |                       the window with window handle handle has changed.      |
  89. ------------------------------------------------------------------------------*/
  90. virtual Boolean
  91.   windowSizeChanged ( IWindowHandle     handle,
  92.                       const IRectangle& newWindowRect,
  93.                       const IRectangle& oldWindowRect  );
  94.  
  95. private:
  96. /*--------------------------------- Private ----------------------------------*/
  97. IRecoordHandlerData
  98.  *fRecoordHandlerData;
  99. }; // IRecoordHandler
  100.  
  101. #pragma pack()
  102.  
  103. #endif /* _IRECOHDR_ */
  104.