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

  1. #ifndef _IMENUEVT_
  2.   #define _IMENUEVT_
  3. /******************************************************************************
  4. * FILE NAME: imenuevt.hpp                                                     *
  5. *                                                                             *
  6. * DESCRIPTION:                                                                *
  7. *    Declaration of the class:                                                *
  8. *      IMenuEvent - Menu event informantion class.                            *
  9. *                                                                             *
  10. * COPYRIGHT:                                                                  *
  11. *   Licensed Materials - Property of IBM                                      *
  12. *   (c) Copyright IBM Corporation 1992, 1993                                  *
  13. *   US Government Users Restricted Rights - Use duplication                   *
  14. *   or disclosure restricted by GSA ADP Schedule Contract                     *
  15. *   with IBM Corp.                                                            *
  16. *                                                                             *
  17. *******************************************************************************/
  18. #ifndef _IEVENT_
  19.   #include <ievent.hpp>
  20. #endif
  21.  
  22. /*----------------------------------------------------------------------------*/
  23. /* Align classes on four byte boundary.                                       */
  24. /*----------------------------------------------------------------------------*/
  25. #pragma pack(4)
  26.  
  27. // Forward declarations for other classes
  28. class IPoint;
  29. class IMenuItem;
  30.  
  31. class IMenuEvent  : public IEvent {
  32. typedef IEvent
  33.   Inherited;
  34. /*******************************************************************************
  35. * The IMenuEvent class is used to provide information about a menu event for   *
  36. * the IMenuHandler event handling functions.                                   *
  37. *******************************************************************************/
  38. public:
  39. /*-------------------------- Constructor ---------------------------------------
  40. |  The only way to construct instances of this class is with an instance of    |
  41. |  the IEvent class.                                                           |
  42. ------------------------------------------------------------------------------*/
  43.   IMenuEvent (IEvent& event);
  44.  ~IMenuEvent ( );
  45.  
  46. /*-------------------------- Accessor ------------------------------------------
  47. | The following functions provides a mean to query the menu event information  |
  48. | of instances of this class.                                                  |
  49. |                                                                              |
  50. |   menuItemId    - Returns the ID of the menu item.                           |
  51. |   menuItem      - Returns an instance of IMenuItem for the menu item.        |
  52. |                   This function can only return an actual IMenuItem when     |
  53. |                   called using the IMenuEvent that is passed as an argument  |
  54. |                   on IMenuHandler::menuSelected.  If called for the other    |
  55. |                   virtual functions, such as makePopUpMenu or menuEnded, an  |
  56. |                   empty IMenuItem for itemId 0 is returned.                  |
  57. |   mousePosition - Returns the mouse position at the time the menu event      |
  58. |                   occurred.  The position is mapped to the menu's owner      |
  59. |                   window coordinates.                                        |
  60. ------------------------------------------------------------------------------*/
  61. unsigned long
  62.   menuItemId ( ) const;
  63.  
  64. IMenuItem
  65.   menuItem ( ) const;
  66.  
  67. IPoint
  68.   mousePosition ( ) const;
  69. };
  70.  
  71. /*----------------------------------------------------------------------------*/
  72. /* Resume compiler default packing.                                           */
  73. /*----------------------------------------------------------------------------*/
  74. #pragma pack()
  75.  
  76. #endif /* IMENUEVT */
  77.