Important: The information in this document is obsolete and should not be used for new development.
SetTranslationAdvertisement
A translation extension can callSetTranslationAdvertisementto install an advertisement into the progress dialog box.
FUNCTION SetTranslationAdvertisement (refNum: TranslationRefNum; advertisement: PicHandle) : OSErr;
refNum- A translation reference number.
advertisement- A handle to a picture to display in the upper portion of the dialog box.
DESCRIPTION
TheSetTranslationAdvertisementfunction installs a translation extension-specific picture into the upper portion of a translation progress dialog box, then displays the dialog box. Theadvertisementparameter should be a handle to the picture to display. If the value ofadvertisementisNIL, no advertisement is displayed and the upper portion of the dialog box is removed before the box is displayed to the user.Your translation extension can read the picture data from its resource fork, but it should detach the resource from the resource fork (by calling
DetachResource) and make the handle unpurgeable before callingSetTranslationAdvertisement. Because you'll usually load the picture data into the temporary heap provided for the translation extension, the picture data is automatically disposed of when that heap is destroyed. If your translation extension loads the picture data elsewhere in memory, you are responsible for disposing of it before returning from yourDoTranslateFileorDoTranslateScraproutine.The size of the picture to display can be no larger than 280 by 50 pixels. If the picture you specify is smaller than that, it is automatically centered (both vertically and horizontally) in the available space.
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 callSetTranslationAdvertisementonly 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 must call
SetTranslationAdvertisementbefore you call theUpdateTranslationProgressprocedure for the first time.The
SetTranslationAdvertisementfunction 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 theSetTranslationAdvertisementfunction are
Trap macro Selector _TranslationDispatch $0002 RESULT CODES
noErr 0 No error paramErr -50 Parameter error memFullErr -108 Not enough memory SEE ALSO
See Figure 7-4 on page 7-7 for a sample translation progress dialog box showing an advertisement. See Listing 7-8 on page 7-34 for an example of the use ofSetTranslationAdvertisement.
 
  
  
 