TakeEvent (process edit-in-place events:EditTextClass)


Top  Previous  Next

 

TakeEvent( event ), VIRTUAL

TakeEvent

Processes an event for the EditTextClass object.

event

An integer constant, variable, EQUATE, or expression that contains the event number (see EVENT in the Language Reference).

The TakeEvent method processes an event for the EditTextClass object and returns a value indicating the user requested action. Valid actions are none, complete or OK, cancel, next record, previous record, next field, and previous field.

Implementation:

The EIPManager.TakeFieldEvent method calls the TakeEvent method. The TakeEvent method processes an EVENT:AlertKey for the edit-in-place control. On EVENT:DroppingDown, TakeEvent invokes a Windwo with a text control. Finally, TakeEvent returns a value indicating the user requested action.

Corresponding EQUATEs for the possible edit-in-place actions are declared in ABEIP.INC as follows:

 

EditAction ITEMIZE(0),PRE

None        EQUATE   ! no action

Forward     EQUATE   ! next field

Backward    EQUATE   ! previous field

Complete    EQUATE   ! OK

Cancel      EQUATE   ! cancel

Next        EQUATE   ! next record

Previous    EQUATE   ! previous record

Ignore      EQUATE   ! no action

          END

 

Return Data Type:     BYTE

Example:

EditClassAction ROUTINE

 CASE SELF.EditList.Control.TakeEvent(EVENT())

 OF EditAction:Forward   !handle tab forward (new field, same record)

 OF EditAction:Backward  !handle tab backward (new field, same record)

 OF EditAction:Next      !handle down arrow (new record, offer to save prior record)

 OF EditAction:Previous  !handle up arrow (new record, offer to save prior record)

 OF EditAction:Complete  !handle OK or enter key (save record)

 OF EditAction:Cancel    !handle Cancel or esc key (restore record)

 END

See Also:     Init