### IMenuEvent

  The IMenuEvent class provides information about a menu event for the event-handling functions of IMenuHandler.

### IMenuEvent - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class.

~IMenuEvent

      public:
      virtual ~IMenuEvent()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

IMenuEvent

      public:
      IMenuEvent(IEvent& event)

  Constructs an IMenuEvent object from the specified event. IMenuHandler::dispatchHandlerEvent constructs objects of this class from an object of the class IEvent and passes the resulting object to its virtual functions.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Event Information

These members query the menu event information of instances of this class.

menuItem

      public:
      IMenuItem menuItem() const

  Returns an object of IMenuItem for the menu item. This function only returns an actual IMenuItem when the IMenuEvent resulted from the user selecting a menu item. If this function is called during any of the other menu actions, an IMenuItem representing an empty itemId 0 is returned.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

menuItemId

      public:
      unsigned long menuItemId() const

  Returns the ID of the menu item. The returned menu item ID can be operated upon by IMenuHandler::menuEnded, IMenuHandler::menuSelected, and IMenuHandler::menuShowing.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

mousePosition

      public:
      IPoint mousePosition() const

  Returns the mouse position at the time the menu event occurred. You can use the value returned as the parameter on IPopUpMenu::show.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

AIX Considerations

  In Motif, the Open Class Library maps the mouse position to the coordinates of the IWindow over which the mouse click occurred.

OS/2 Considerations

  In Presentation Manager, the Open Class Library maps the mouse position to the menu's owner window's coordinates.

### IMenuEvent - Inherited Member Functions and Data

#### Inherited Public Functions

  IEvent

  -     virtual ~IEvent()

  -     IWindowHandle controlHandle() const

  -     virtual IWindow* controlWindow() const

  -     IEvent& decrementOwnerLevels()

  -     virtual IWindow* dispatchingWindow() const

  -     unsigned long eventId() const

  -     IWindowHandle handle() const

  -     IEvent( IWindow* window,
                unsigned long eventId,
                const IEventParameter1& parameter1,
                const IEventParameter2& parameter2 )

  -     IEvent( const IWindowHandle& handle,
                unsigned long eventId,
                const IEventParameter1& parameter1,
                const IEventParameter2& parameter2 )

  -     IEvent(const IEvent& event)

  -     IEvent& operator =(const IEvent& event)

  -     IEventParameter1 parameter1() const

  -     IEventParameter2 parameter2() const

  -     bool passToOwner() const

  -     IEventResult result() const

  -     IEvent& setControlHandle(const IWindowHandle& handle)

  -     IEvent& setDispatchingHandle(const IWindowHandle& handle)

  -     IEvent& setDispatchingWindow(IWindow* window)

  -     IEvent& setHandle(const IWindowHandle& handle)

  -     IEvent& setNumberOfLevels(int levels = - 1)

  -     IEvent& setPassToOwner(bool passOn = true)

  -     IEvent& setResult(bool eventResult)

  -     IEvent& setResult(const IEventResult& eventResult)

  -     virtual IWindow* window() const

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  - None

#### Inherited Protected Data

  - None