ICnrMenuHandler

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.


ICnrMenuHandler - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~ICnrMenuHandler
public:
virtual ~ICnrMenuHandler()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
ICnrMenuHandler
protected:
ICnrMenuHandler()

You can only construct objects of this class by using the default constructor, which does not accept any parameters.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Dispatching

These members are overridden to implement the class.


[view class]
handleEventsFor
public:
virtual ICnrMenuHandler& handleEventsFor( IContainerControl* container )

Attaches the handler to the specified container control.
Note: This handler cannot be attached to IWindow*, and the inherited function for doing so is private.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
stopHandlingEventsFor
public:
virtual ICnrMenuHandler& stopHandlingEventsFor( IContainerControl* container )

Detaches the handler from the specified container control.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
addSourceEmphasis
protected:
virtual void addSourceEmphasis(const IMenuEvent& menuEvent)

Adds source emphasis by calling IContainerControl::showSourceEmphasis.

Source emphasis is added as follows:

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored

AIX Considerations

This function is ignored for the Motif container widget. Source emphasis is not supported in this case.

Windows Considerations

This function is ignored for both the Windows native containers and the pmCompatible containers. Source emphasis is not supported in either case.


[view class]
dispatchHandlerEvent
protected:
virtual bool dispatchHandlerEvent(IEvent& event)

When a container menu event is received, the appropriate virtual function is called.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
menuEnded
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
removeSourceEmphasis
protected:
virtual void removeSourceEmphasis( const IMenuEvent& menuEvent )

Removes source emphasis by calling IContainerControl::hideSourceEmphasis.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored

Windows Considerations

This function is ignored for both the Windows native containers and the pmCompatible containers. Source emphasis is not supported in either case.


Event Information

Use these members to query and set the accessible attributes of this class.


[view class]
popupMenuObject
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


ICnrMenuHandler - Inherited Member Functions and Data

Inherited Public Functions

IHandler
IMenuHandler

Inherited Public Data

Inherited Protected Functions

IHandler
IMenuHandler

Inherited Protected Data