Important: The information in this document is obsolete and should not be used for new development.
SetTranslationAdvertisement
A translation extension can callSetTranslationAdvertisement
to 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
TheSetTranslationAdvertisement
function installs a translation extension-specific picture into the upper portion of a translation progress dialog box, then displays the dialog box. Theadvertisement
parameter should be a handle to the picture to display. If the value ofadvertisement
isNIL
, 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 yourDoTranslateFile
orDoTranslateScrap
routine.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
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 callSetTranslationAdvertisement
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 must call
SetTranslationAdvertisement
before you call theUpdateTranslationProgress
procedure for the first time.The
SetTranslationAdvertisement
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 theSetTranslationAdvertisement
function 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
.