### ICnrHandler

  The ICnrHandler class provides the basic event-handling capability for the container.

  Create a handler derived from ICnrHandler and attach it to the container whose events are to be handled. You can do this by calling handleEventsFor to pass the container to the container handler.

  ICnrHandler processes the following events from the container:

  - Changing selection, in-use, or cursored emphasis for an object in the container. This is described in ICnrEmphasisEvent.
  - Scrolling past the container's delta value. This is described in ICnrQueryDeltaEvent.
  - Responding to an enter event using the keyboard or mouse. This is described in ICnrEnterEvent.
  - Requesting help within the container. This is described in ICnrHelpEvent.
  - Expanding and collapsing nodes in a tree view. This is described in IContainerObject.
  - Scrolling the container window. This is described in ICnrScrollEvent.

  When the container handler receives one of these events, it creates a corresponding event object and routes that object to the appropriate ICnrHandler virtual function. You must override these virtual functions to supply your own specialized processing of these events.

### ICnrHandler - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class.

~ICnrHandler

      public:
      virtual ~ICnrHandler()

Supported Platforms

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

ICnrHandler

      public:
      ICnrHandler()

  Provides the default constructor, which does not accept any parameters.

Supported Platforms

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

### Event Dispatching

Use these members to implement the class.

handleEventsFor

      public:
      virtual ICnrHandler&
        handleEventsFor( IContainerControl* container )

  Attaches the handler to the specified container control.

Supported Platforms

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

stopHandlingEventsFor

      public:
      virtual ICnrHandler&
        stopHandlingEventsFor( IContainerControl* container )

  Detaches the handler from the specified container control.

Supported Platforms

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

dispatchHandlerEvent

      protected:
      virtual bool dispatchHandlerEvent(IEvent& event)

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

Supported Platforms

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

### Event Processing

Event-processing members must be supplied by a derived class to provide processing for an edit event.

cursoredChanged

      public:
      virtual bool cursoredChanged(ICnrEmphasisEvent& event)

  Called when the cursored emphasis of an object changes. By default, this function calls IContainerObject::handleCursoredChange on the object whose emphasis has changed.

Supported Platforms

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

deltaReached

      public:
      virtual bool deltaReached(ICnrQueryDeltaEvent& event)

  Called when the container is scrolled to the predefined delta.

Supported Platforms

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

Windows Considerations

  The native Windows containers (that is, containers constructed without the pmCompatible style) do not support data caching. This function is not called in this case.

enter

      public:
      virtual bool enter(ICnrEnterEvent& event)

  Called when the user selects the Enter key or double-clicks the mouse select button on an object. If the enter occurs over an object, by default, this function calls IContainerObject::handleOpen. Otherwise, this function ignores the enter.

Supported Platforms

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

help

      public:
      virtual bool help(ICnrHelpEvent& event)

  Called when help is requested in a container.

Supported Platforms

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

inuseChanged

      public:
      virtual bool inuseChanged(ICnrEmphasisEvent& event)

  Called when the in-use emphasis of an object changes. By default, this function calls IContainerObject::handleInuseChange.

Supported Platforms

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

selectedChanged

      public:
      virtual bool selectedChanged(ICnrEmphasisEvent& event)

  Called when the selection emphasis of an object changes. By default, this function calls IContainerObject::handleSelectedChange.

Supported Platforms

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

treeCollapsed

      public:
      virtual bool
        treeCollapsed( IContainerObject* collapsedObject,
                       IContainerControl* container )

  Called when the specified object is collapsed in the specified container. By default, this function calls IContainerObject::handleTreeCollapse.

Supported Platforms

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

treeExpanded

      public:
      virtual bool
        treeExpanded( IContainerObject* expandedObject,
                      IContainerControl* container )

  Called when the specified object is expanded in the specified container. By default, this function calls IContainerObject::handleTreeExpand on the expanded object.

Supported Platforms

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

windowScrolled

      public:
      virtual bool windowScrolled(ICnrScrollEvent& event)

  Called when the container window is scrolled.

Supported Platforms

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

AIX Considerations

  This function is not called for a Motif container widget as ICnrScrollEvent is not supported in this case.

Windows Considerations

  This function is not called for a native Windows container as ICnrScrollEvent is not supported in this case.

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

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IHandler

  -     virtual IEventResult defaultProcedure(IEvent& event)

  -     virtual bool dispatchHandlerEvent(IEvent& event) = 0

#### Inherited Protected Data

  - None