home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / extlib / valueset / vsethdr.hpp < prev   
Encoding:
C/C++ Source or Header  |  1996-10-29  |  2.5 KB  |  70 lines

  1. #ifndef _VSETHDR_
  2. #define _VSETHDR_
  3. //************************************************************
  4. // Extending the Library - Value Set Example
  5. //
  6. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  7. // All Rights Reserved.
  8. //************************************************************
  9.  
  10. #ifndef _IHANDLER_
  11.   #include <ihandler.hpp>
  12. #endif
  13.  
  14. #ifndef _VSETEVT_
  15.   #include "vsetevt.hpp"
  16. #endif
  17.  
  18. class ValueSet;
  19.  
  20. class ValueSetHandler : public IHandler {
  21. typedef IHandler
  22.   Inherited;
  23. /*******************************************************************************
  24. * This class provides a base from which you can derive your own special        *
  25. * handlers to be attached to value set controls.                               *
  26. *******************************************************************************/
  27. public:
  28. /*------------------------------- Constructor ----------------------------------
  29. | The constructor accepts an optional ValueSet control object.  If             |
  30. | provided, then the new handler is automatically attached.                    |
  31. ------------------------------------------------------------------------------*/
  32.   ValueSetHandler ( ValueSet &vset );
  33.   ValueSetHandler ( );
  34.  
  35. virtual
  36.   ~ValueSetHandler ( );
  37.  
  38. /*-------------------------------- Attaching -----------------------------------
  39. | You can only attach these handlers to ValueSet controls.                     |
  40. ------------------------------------------------------------------------------*/
  41. virtual ValueSetHandler
  42.  &handleEventsFor( ValueSet *vset );
  43.  
  44. protected:
  45. /*------------------------------ Event Handling --------------------------------
  46. | These functions should be overridden to add your event handling.             |
  47. ------------------------------------------------------------------------------*/
  48. virtual Boolean
  49.   enter     ( ValueSetEvent &vsetEvent ),
  50.   selected  ( ValueSetEvent &vsetEvent ),
  51.   gotFocus  ( ValueSetEvent &vsetEvent ),
  52.   lostFocus ( ValueSetEvent &vsetEvent ),
  53.   help      ( ValueSetEvent &vsetEvent );
  54.  
  55. /*------------------------------ Implementation --------------------------------
  56. | These functions provide utility services used to implement this class.       |
  57. ------------------------------------------------------------------------------*/
  58. virtual Boolean
  59.   dispatchHandlerEvent ( IEvent &event );
  60.  
  61. private:
  62. virtual ValueSetHandler
  63.  &handleEventsFor( IWindow * );
  64.  
  65.   ValueSetHandler ( const ValueSetHandler & );
  66.   operator = ( const ValueSetHandler & );
  67. }; // class ValueSetHandler
  68.  
  69. #endif // _VSETHDR_
  70.