### 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.

~ICnrMenuHandler

      public:
      virtual ~ICnrMenuHandler()

Supported Platforms

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

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.

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

stopHandlingEventsFor

      public:
      virtual ICnrMenuHandler&
        stopHandlingEventsFor( IContainerControl* container )

  Detaches the handler from the specified container control.

Supported Platforms

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

addSourceEmphasis

      protected:
      virtual void addSourceEmphasis(const IMenuEvent& menuEvent)

  Adds source emphasis by calling IContainerControl::showSourceEmphasis.

  Source emphasis is added as follows:

  - If the object is not selected, source emphasis is displayed on the object.
  - If the object is selected and other objects are also selected, source emphasis is displayed on the group of objects.
  - If a pop-up menu is selected off of an object, source emphasis is displayed on the container itself.

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.

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

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

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.

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

  -     virtual ~IHandler()

  -     virtual IString asDebugInfo() const

  -     virtual IString asString() const

  -     virtual IHandler& disable()

  -     virtual IHandler& enable(bool enable = true)

  -     IHandler()

  -     bool isEnabled() const

  IMenuHandler

  -     virtual ~IMenuHandler()

  -     IMenuHandler()

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IHandler

  -     virtual IEventResult defaultProcedure(IEvent& event)

  -     virtual bool dispatchHandlerEvent(IEvent& event) = 0

  IMenuHandler

  -     virtual bool makePopUpMenu(IMenuEvent& menuEvent)

  -     virtual bool menuSelected(IMenuEvent& menuEvent)

  -     virtual bool
          menuShowing( IMenuEvent& menuEvent,
                       ISubmenu& submenuAboutToShow )

#### Inherited Protected Data

  - None