The IMenuEvent class provides information about a menu event for the event-handling functions of IMenuHandler.
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IMenuEvent()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
These members query the menu event information of instances of this class.
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
In Motif, the Open Class Library maps the mouse position to the coordinates of the IWindow over which the mouse click occurred.
In Presentation Manager, the Open Class Library maps the mouse position to the menu's owner window's coordinates.
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