CancelAdd
|
Previous Top Next |
:CancelAdd := {|Self, cSource, lSubDir| ... } --> nQuit
|
Self
|
Self contains a reference to the XbZLibZip object itself.
|
cSource
|
cSource contains the Name of the Directory or Sub-Directory from which Files are currently read.
|
lSubDir
|
lSubDir determines if the process is currently adding files from a Sub-Directory or not. It will be .T. (TRUE) if cSource is a Sub-Directory and .F. (FALSE) if cSource is the actual Main or Root Directory.
|
nQuit
|
nQuit determines if the Adding of Files should be cancelled or not. It might be one of the following numeric Define Constant values from XbZLib.ch, depending on the requested behavior:
|
|
During the Adding/Updating of Multiple Files/Entries to the Zip File with the :AddDir() method, the protected method :EventLoop() is called after each File/Item has been processed. If the :EventLoop() method returns .T. (TRUE) -- which constitutes a request to Cancel the current process -- the protected :CancelAdd() method is called next, to allow the user to confirm that the process should really be cancelled, and if so, if adding files from only the current directory or adding of any files should be cancelled.
|
|
By default, the :CancelAdd() method will simply display a Message Box that shows that the adding of files from the current directory or the adding of all files has been cancelled. This default behavior does not allow the user to choose or even cancel the request!
|
|
If the :CancelAdd Callback Slot contains a CodeBlock, that CodeBlock is instead executed. This CodeBlock may or may not allow the user to select one of the (above listed) possible options. The expected Return Value of this CodeBlock must be numeric, and determines if the process should actually be cancelled and to which extent. Invalid (or missing) return values will default to XBZ_DONT_QUIT, and the adding of files continues.
|
· | Standard (default) behavior -- Display Message and Quit Current Directory (only):
|
|
oZip:CancelAdd := NIL
|
· | Always Continue -- Disable Cancel and don't show any Message:
|
|
oZip:CancelAdd := {|oZ, cDir, lDir| XBZ_DONT_QUIT}
|
· | Always Quit Immediately without any Message:
|
|
oZip:CancelAdd := {|oZ, cDir, lDir| XBZ_QUIT_ALL}
|
· | Call an interactive UDF (User-Defined Function) named "LetUserDecide()", which should return an appropriate Cancel Code:
|
|
oZip:CancelAdd := {|oZ, cDir, lDir| LetUserDecide(oZ, cDir, lDir)}
|