Navigation: ABC Library Reference > WindowManager > WindowManager Methods >====== TakeCloseEvent (a virtual to Cancel the window) ====== | ![]() ![]() |
TakeCloseEvent, VIRTUAL, PROC
The TakeCloseEvent method processes EVENT:CloseWindow and EVENT:CloseDown events for the window and returns a value indicating whether window ACCEPT loop processing is complete and should stop.
TakeCloseEvent implements the default processing when the end user cancels an update form (presses the Cancel button). The actual process depends on the value of various WindowManager properties, including Request, Response, CancelAction, OriginalRequest, etc.
TakeCloseEvent returns returns Level:Benign to indicate processing of this event should continue normally; it returns Level:Notify to indicate processing is completed for this event and the ACCEPT loop should CYCLE; it returns Level:Fatal to indicate the event could not be processed and the ACCEPT loop should BREAK.
Implementation:
The TakeEvent method calls the TakeCloseEvent method. The TakeCloseEvent method undoes any processing rendered invalid by the form cancellation (for example, deleting a dummy autoincremented record that is no longer needed).
Return values are declared in ABERROR.INC.
Return Data Type: BYTE
Example:
MyWindowManager.TakeEvent PROCEDURE
Rval BYTE(Level:Benign)
I USHORT,AUTO
CODE
IF ~FIELD()
RVal = SELF.TakeWindowEvent()
IF RVal THEN RETURN RVal.
END
CASE EVENT()
OF EVENT:Accepted; RVal = SELF.TakeAccepted()
OF EVENT:Rejected; RVal = SELF.TakeRejected()
OF EVENT:Selected; RVal = SELF.TakeSelected()
OF EVENT:NewSelection; RVal = SELF.TakeNewSelection()
OF EVENT:Completed; RVal = SELF.TakeCompleted()
OF EVENT:CloseWindow OROF EVENT:CloseDown
RVal = SELF.TakeCloseEvent()
END
IF RVal THEN RETURN RVal.
IF FIELD()
RVal = SELF.TakeFieldEvent()
END
RETURN RVal
See Also: CancelAction, Request, Response, OriginalRequest, TakeEvent





