The ICnrMenuHandler class extends the class IMenuHandler by providing specific information related to the menu. Primarily, this means providing the object over which the menu was requested.
Create a handler derived from ICnrMenuHandler and attach it to the container whose menu events are to be handled. You can do this by calling handleEventsFor to pass the appropriate container to the container menu handler.
When the container menu handler receives a container menu event, it creates an IMenuEvent object and routes that object to the appropriate ICnrMenuHandler virtual function. You must override these virtual functions to supply your own specialized processing of a container menu event.
You can construct and destruct objects of this class.
![]() |
protected:
ICnrMenuHandler()
You can only construct objects of this class by using the default constructor, which does not accept any parameters.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
These members are overridden to implement the class.
![]() |
public:
virtual ICnrMenuHandler& handleEventsFor( IContainerControl* container )
Attaches the handler to the specified container control.
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual ICnrMenuHandler& stopHandlingEventsFor( IContainerControl* container )
Detaches the handler from the specified container control.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual void addSourceEmphasis(const IMenuEvent& menuEvent)
Adds source emphasis by calling IContainerControl::showSourceEmphasis.
Source emphasis is added as follows:
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
This function is ignored for the Motif container widget. Source emphasis is not supported in this case.
This function is ignored for both the Windows native containers and the pmCompatible containers. Source emphasis is not supported in either case.
![]() |
protected:
virtual bool dispatchHandlerEvent(IEvent& event)
When a container menu event is received, the appropriate virtual function is called.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual bool menuEnded(IMenuEvent& menuEvent)
Resets the pointer to the menu object that is stored when the menu is created and calls IMenuHandler::menuEnded to complete the processing.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual void removeSourceEmphasis( const IMenuEvent& menuEvent )
Removes source emphasis by calling IContainerControl::hideSourceEmphasis.
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
This function is ignored for both the Windows native containers and the pmCompatible containers. Source emphasis is not supported in either case.
Use these members to query and set the accessible attributes of this class.
![]() |
public:
IContainerObject* popupMenuObject()
Returns the object for which a pop-up menu was requested. If a pop-up menu was not requested for an object, 0 is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual ~IMenuHandler()
IMenuHandler()
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0
virtual bool makePopUpMenu(IMenuEvent& menuEvent)
virtual bool menuSelected(IMenuEvent& menuEvent)
virtual bool menuShowing( IMenuEvent& menuEvent, ISubmenu& submenuAboutToShow )