Important: The information in this document is obsolete and should not be used for new development.
UpdateTranslationProgress
A translation extension can callUpdateTranslationProgressto 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,
UpdateTranslationProgressreturnsTRUEin this parameter if the user clicked the Cancel button in the progress dialog box; otherwise,UpdateTranslationProgressreturnsFALSEin this parameter.DESCRIPTION
TheUpdateTranslationProgressfunction 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), thecanceledparameter is set toTRUE; otherwise, it is set toFALSE. WhencanceledreturnsTRUE, you should stop the translation, and your application-defined routineDoTranslateFileorDoTranslateScrapshould return the result codeuserCancelledErr.The
percentDoneparameter specifies the approximate percentage of time elapsed until completion. You should callUpdateTranslationProgressperiodically at reasonable time intervals to allow the user to cancel the translation. When the translation is complete, you should callUpdateTranslationProgresswithpercentDoneset to 100 so that the user can see that the translation is complete.You should set the
refNumparameter to the translation reference number passed to yourDoTranslateFileorDoTranslateScraproutine. The Translation Manager uses that number internally.SPECIAL CONSIDERATIONS
Your translation extension should callUpdateTranslationProgressonly in response to thekTranslateTranslateFileorkTranslateTranslateScraprequest code (that is, in yourDoTranslateFileorDoTranslateScraproutine). 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
SetTranslationAdvertisementbefore callingUpdateTranslationProgress.The
UpdateTranslationProgressfunction 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 theUpdateTranslationProgressfunction are
Trap macro Selector _TranslationDispatch $0001 RESULT CODES
noErr 0 No error paramErr -50 Parameter error memFullErr -108 Not enough memory