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

  1. #ifndef _IPAINHDR_
  2. #define _IPAINHDR_
  3. /*******************************************************************************
  4. * FILE NAME: ipainhdr.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IPaintHandler                                                            *
  9. *     IPaintConnectionTo                                                       *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   IBM Open Class Library                                                     *
  13. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  14. *   Licensed Material - Program-Property of IBM - 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. *******************************************************************************/
  19. #include <ihandler.hpp>
  20. #include <ipainevt.hpp>
  21.  
  22. #pragma pack(4)
  23.  
  24. class IPaintHandler : public IHandler {
  25. typedef IHandler
  26.   Inherited;
  27. public:
  28. /*------------------------------- Constructors -------------------------------*/
  29. virtual
  30.  ~IPaintHandler ( );
  31.  
  32. protected:
  33. /*------------------------------- Constructors -------------------------------*/
  34.   IPaintHandler ( );
  35.  
  36. /*---------------------------- Event Dispatching -----------------------------*/
  37. virtual Boolean
  38.   dispatchHandlerEvent ( IEvent& event );
  39.  
  40. /*----------------------------- Event Processing -----------------------------*/
  41. virtual Boolean
  42.   paintWindow ( IPaintEvent& event ) = 0;
  43. }; // IPaintHandler
  44.  
  45. #pragma info(nocpy)
  46.  
  47. template <class ATarget>
  48. class IPaintConnectionTo : public IPaintHandler {
  49. typedef IPaintHandler
  50.   Inherited;
  51. public:
  52. /*----------------------------- Type Definitions -----------------------------*/
  53. typedef Boolean  (ATarget::* MemberFunction)( IPaintEvent& );
  54.  
  55. /*------------------------------- Constructors -------------------------------*/
  56.   IPaintConnectionTo ( ATarget&       target,
  57.                        MemberFunction memberFunction );
  58. virtual
  59.  ~IPaintConnectionTo ( );
  60.  
  61. protected:
  62. /*----------------------------- Event Processing -----------------------------*/
  63. virtual Boolean
  64.   paintWindow ( IPaintEvent& event );
  65.  
  66. private:
  67. /*--------------------------------- Private ----------------------------------*/
  68. ATarget
  69.  &fTarget;
  70. MemberFunction
  71.   fConnectedMember;
  72. };  // IPaintConnectionTo
  73.  
  74.  
  75. #ifndef __TEMPINC__
  76.   #include <ipainhdr.c>
  77. #endif
  78.  
  79. #pragma info(restore)
  80.  
  81. #pragma pack()
  82.  
  83. #endif /* _IPAINHDR_ */
  84.