      *>---------------------------------------------------------
      *> DOCS-ROOT.
      *> An instance of Event contains information about an event
      *> raised by an object sending the "dispatchEvent" message.
      *> You can interrogate the event instance to get the id of the
      *> event, and the handle of the object which dispatched the event.
      *>
      *> Event objects are sent as parameters to methods registered
      *> against events using the "setEventTo" method. The dispatcher
      *> of an event should finalize the event after it has been sent
      *> with the "dispatchEvent" message. The receiver of an event
      *> must make its own copy of event information if this is
      *> needed after the receiving method exits.
      *>
      *>#See method "dispatchEvent" in class "base".
      *>#See method "setEventTo" in class "base".
      *>
      *> Copyright (C) 1991-1999 Micro Focus International Ltd.
      *>
      *>---------------------------------------------------------

       class-id. event data is protected
               inherits from base with data.

       object section.
       class-control.
           event is class "event"
           base is class "base".


       class-object.
       object-storage section.


      *>---------------------------------------------------------
      *> Create a new event object for lnkObject and lnkEventId
      *>---------------------------------------------------------
       method-id. "withObjectEventId".
       linkage section.
       01 lnkEventId   pic x(4) comp-5.
       01 lnkObject    usage object reference.
       01 lnkEvent     usage object reference.

       procedure division using lnkObject
                       by value lnkEventId
                      returning lnkEvent.
           invoke super "new" returning lnkEvent
           invoke lnkEvent "initialize" using lnkObject
                                              lnkEventId
           exit method.
       end method "withObjectEventId".
       end class-object.

       Object.

       object-storage section.
       01 receiver usage object reference value null.
       01 eventId  pic x(4) comp-5 value 0.
      *>---------------------------------------------------------
      *> PRIVATE. Sets the receiver of the event
      *>---------------------------------------------------------
       method-id. "setObject".
       linkage section.
       01 lnkObject usage object reference.

       procedure division using lnkObject.
           set receiver to lnkObject
           exit method.
       end method "setObject".

      *>---------------------------------------------------------
      *> PRIVATE. Set the id of the event
      *>---------------------------------------------------------
       method-id. "initialize".
       linkage section.
       01 lnkEventId   pic x(4) comp-5.
       01 lnkObject    usage object reference.

       procedure division using lnkObject lnkEventId.
           set receiver to lnkObject
           move lnkEventId to eventId
           exit method.
       end method "initialize".
      *>---------------------------------------------------------
      *> Return the id of the event
      *>---------------------------------------------------------
       method-id. "getId".
       linkage section.
       01 lnkEventId pic x(4) comp-5.

       procedure division returning lnkEventId.
           move eventId to lnkEventId
           exit method.
       end method "getId".
      *>---------------------------------------------------------
      *> Returns the object that received the event
      *>---------------------------------------------------------
       method-id. "getObject".
       linkage section.
       01 lnkObject usage object reference.

       procedure division returning lnkObject.
           set lnkObject to receiver
           exit method.
       end method "getObject".

      *>---------------------------------------------------------
      *> Set the id of this event ti lnkEventId.
      *>---------------------------------------------------------
       method-id. "setId".
       linkage section.
       01 lnkEventId pic x(4) comp-5.

       procedure division using lnkEventId.
           move lnkEventId to eventId
           exit method.
       end method "setId".
       end object.
       end class event.
