home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / ICMDEVT.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  4KB  |  89 lines

  1. #ifndef _ICMDEVT_
  2.   #define _ICMDEVT_
  3. /*******************************************************************************
  4. * FILE NAME: icmdevt.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     ICommandEvent - the command event class                                  *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   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.  
  19. // Forward declarations for other classes:
  20.  
  21. #ifndef _IEVENT_
  22.   #include <ievent.hpp>
  23. #endif
  24.  
  25. /*----------------------------------------------------------------------------*/
  26. /* Align classes on four byte boundary.                                       */
  27. /*----------------------------------------------------------------------------*/
  28. #pragma pack(4)
  29.  
  30. class ICommandEvent : public IEvent {
  31. typedef IEvent
  32.   Inherited;
  33. /*******************************************************************************
  34. * The ICommandEvent class represents an application-specific or system
  35. * command.  Instances of this class are constructed and processed by the
  36. * ICommandHandler class, typically as a result of the user selecting a push    *
  37. * button or menu item.                                                         *
  38. *******************************************************************************/
  39. public:
  40. /*------------------------------- Constructor ----------------------------------
  41. | The only way to construct instances of this class is from an instance of     |
  42. | IEvent.  The event class instance is used to create the ICommandEvent        |
  43. | instance.                                                                    |
  44. ------------------------------------------------------------------------------*/
  45.   ICommandEvent ( IEvent& event );
  46.  ~ICommandEvent ( );
  47.  
  48. /*-------------------------------- Accessors -----------------------------------
  49. | These functions provide means of getting and setting the accessible          |
  50. | attributes of instances of this class:                                       |
  51. |   Source      - Identifies the origin of the command event.                  |
  52. |   source      - Returns the enumerator that corresponds to the way in which  |
  53. |                 the command event was initiated.                             |
  54. |   commandId   - Returns the push button ID, menu item ID, or other command   |
  55. |                 ID of the button, menu, or other object that initiated the   |
  56. |                 command event.                                               |
  57. |   isFromFrame - Returns whether the event has already been dispatched to the |
  58. |                 frame window, and consequently whether it should again be    |
  59. |                 dispatched to the frame.                                     |
  60. ------------------------------------------------------------------------------*/
  61. enum Source
  62. {
  63.   pushButton,
  64.   menu,
  65.   accelerator,
  66.   unknown
  67. };
  68.  
  69. Source
  70.   source      ( ) const;
  71. unsigned long
  72.   commandId   ( ) const;
  73.  
  74. Boolean
  75.   isFromFrame ( ) const;
  76. }; // ICommandEvent
  77.  
  78. /*----------------------------------------------------------------------------*/
  79. /* Resume compiler default packing.                                           */
  80. /*----------------------------------------------------------------------------*/
  81. #pragma pack()
  82.  
  83. /*----------------------------- Inline Functions -----------------------------*/
  84. #ifndef I_NO_INLINES
  85.   #include <icmdevt.inl>
  86. #endif
  87.  
  88. #endif /* _ICMDEVT_ */
  89.