Important: The information in this document is obsolete and should not be used for new development.
UpdateTranslationProgress
A translation extension can callUpdateTranslationProgress
to update the progress dialog box that is displayed during file and scrap translation and to give the user a chance to click the Cancel button.
FUNCTION UpdateTranslationProgress (refNum: TranslationRefNum; percentDone: Integer; VAR canceled: Boolean) : OSErr;
refNum
- A translation reference number.
percentDone
- An integer in the range 0-100 that indicates the percentage of the translation that has been completed.
canceled
- On exit,
UpdateTranslationProgress
returnsTRUE
in this parameter if the user clicked the Cancel button in the progress dialog box; otherwise,UpdateTranslationProgress
returnsFALSE
in this parameter.DESCRIPTION
TheUpdateTranslationProgress
function updates the translation progress dialog box. You should call this function periodically during a translation to update the progress bar and to give the user an opportunity to cancel the translation. If the user clicks the Cancel button in the dialog box (or types Command-period while the box is displayed), thecanceled
parameter is set toTRUE
; otherwise, it is set toFALSE
. Whencanceled
returnsTRUE
, you should stop the translation, and your application-defined routineDoTranslateFile
orDoTranslateScrap
should return the result codeuserCancelledErr
.The
percentDone
parameter specifies the approximate percentage of time elapsed until completion. You should callUpdateTranslationProgress
periodically at reasonable time intervals to allow the user to cancel the translation. When the translation is complete, you should callUpdateTranslationProgress
withpercentDone
set to 100 so that the user can see that the translation is complete.You should set the
refNum
parameter to the translation reference number passed to yourDoTranslateFile
orDoTranslateScrap
routine. The Translation Manager uses that number internally.SPECIAL CONSIDERATIONS
Your translation extension should callUpdateTranslationProgress
only in response to thekTranslateTranslateFile
orkTranslateTranslateScrap
request code (that is, in yourDoTranslateFile
orDoTranslateScrap
routine). Do not call this function in response to any other request code or from any code that isn't a translation extension.You should already have called
SetTranslationAdvertisement
before callingUpdateTranslationProgress
.The
UpdateTranslationProgress
function might cause memory to be moved or purged; you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theUpdateTranslationProgress
function are
Trap macro Selector _TranslationDispatch $0001 RESULT CODES
noErr 0 No error paramErr -50 Parameter error memFullErr -108 Not enough memory