home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lstbx3.zip / xlisthdr.hpp < prev    next >
Text File  |  1994-05-23  |  5KB  |  98 lines

  1. #ifndef _XLISTHDR_
  2. #define _XLISTHDR_
  3. /*******************************************************************************
  4. * FILE NAME: xlisthdr.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *   ListBox32Handler - Handler class for 32-Bit list box control.              *
  9. *                                                                              *
  10. *******************************************************************************/
  11. #ifndef _IHANDLER_
  12.   #include <ihandler.hpp>
  13. #endif
  14.  
  15. #ifndef _XLISTEVT_
  16.   #include "xlistevt.hpp"
  17. #endif
  18.  
  19. //Forward declarations
  20. class ListBox32;
  21.  
  22. /*----------------------------------------------------------------------------*/
  23. /* Align classes on four byte boundary.                                       */
  24. /*----------------------------------------------------------------------------*/
  25. #pragma pack(4)
  26.  
  27. class ListBox32Handler : public IHandler {
  28. typedef IHandler
  29.   Inherited;
  30. /*******************************************************************************
  31. *                                                                              *
  32. *******************************************************************************/
  33. public:
  34. /*-------------------------- Constructor/Destructor ----------------------------
  35. | You can construct generic objects of this class by providing the following:  |
  36. |    o From a pointer to a ListBox32 object.  This ctor will attach the        |
  37. |      handler to the object if the object is provided.                        |
  38. ------------------------------------------------------------------------------*/
  39.   ListBox32Handler   ( ListBox32 *listBox = 0 );
  40.  
  41. virtual
  42.   ~ListBox32Handler  ( );
  43.  
  44. /*---------------------------- Window Attachment -------------------------------
  45. | handleEventsFor - Attaches this handler to the ListBox32 object.             |
  46. ------------------------------------------------------------------------------*/
  47. virtual ListBox32Handler
  48.  &handleEventsFor  ( ListBox32 *listBox );
  49.  
  50.  
  51. protected:
  52. /*---------------------------- Event Dispatching -------------------------------
  53. | This function evaluates the event to determine if it is appropriate for      |
  54. | this handler object to process.  If it is, it calls a virtual function used  |
  55. | to process the event.                                                        |
  56. |   dispatchHandlerEvent - Override to process events destined for our         |
  57. |                          "ListBoxWindow" window class.                       |
  58. ------------------------------------------------------------------------------*/
  59. virtual Boolean
  60.   dispatchHandlerEvent ( IEvent &event );
  61.  
  62. /*------------------------ Event Processing Functions --------------------------
  63. | These functions should be supplied by a derived class in order to provide    |
  64. | processing for a selection, enter, or a focus change event.                  |
  65. |   enter     - Implemented by derived classes to process an enter event.      |
  66. |   selected  - Implemented by derived classes to process a selection event.   |
  67. |   gotFocus  - Implemented by derived classes to process a focus gain event.  |
  68. |   lostFocus - Implemented by derived classes to process a focus loss event.  |
  69. |   scroll    - Implemented by derived classes to process a scroll event.      |
  70. |   checked   - Implemented by derived classes to process a check event.       |
  71. ------------------------------------------------------------------------------*/
  72. virtual Boolean
  73.   enter      ( const ListBox32Event &event ),
  74.   selected   ( const ListBox32Event &event ),
  75.   gotFocus   ( const ListBox32Event &event ),
  76.   lostFocus  ( const ListBox32Event &event ),
  77.   scroll     ( const ListBox32Event &event ),
  78.   checked    ( const ListBox32Event &event );
  79.  
  80.  
  81. private:
  82. /*--------------------------------- PRIVATE ----------------------------------*/
  83. virtual ListBox32Handler
  84.  &handleEventsFor   ( IWindow * );
  85.  
  86.   ListBox32Handler  ( const ListBox32Handler & );  //copy ctor
  87.   operator =        ( const ListBox32Handler & );  //assignment ctor
  88.  
  89. };  // class ListBox32Handler
  90.  
  91.  
  92. /*----------------------------------------------------------------------------*/
  93. /* Resume compiler default packing.                                           */
  94. /*----------------------------------------------------------------------------*/
  95. #pragma pack()
  96.  
  97. #endif  //_XLISTHDR_
  98.