Sets the custom icon, to be used in subsequent dialogs where the switch “-customIcon” is specified.
Dial_IconControl ( switches ; theIcon )
|switches||this determines the behaviour of the function|
|theIcon||small JPG or PNG image to show at the left of the dialog|
Switches must be one of these:
|-SetCustomIcon||sets the custom icon|
|-ForgetCustomIcon||forgets and frees the memory for the custom icon|
|-DefaultIconSize=48||this will make it the default to show all icons at 48×48, without the need to set it for each dialog function call|
Data type returned
If successful it returns 0.
If unsuccessful it returns an error code starting with $$ and the error code. Returned error codes can be:
|$$-41||not enough memory|
Other errors may be returned. (See the OSErrrs database for more information on error codes).
Troi Dialog Plug-in 1.2
FileMaker Pro 12 to 17
You can specify an image of any size. However, as the dialogs show the icons at either 32×32 or 48×48 pixels, it is best to use one of these sizes.
You can use a custom icon with most of the functions: Dialog, ListDialog, InputDialog, BigInputDialog and FlashDialog.
If you set the custom icon again the old one is deleted. To reset the icon use the -ForgetCustomIcon switch.
Mac OS: supports PNG (including transparency) and JPEG.
On Windows: PNG (including transparency), JPEG and GIFs are supported.
We assume that in your FileMaker file the following fields are defined:
gCustomIcon Global, container gErrorCode Global, text
gCustomIcon should contain an icon. Add the following script steps:
Set Field [ gErrorCode ; Dial_IconControl ( "-SetCustomIcon" ; gCustomIcon ) ] If [ Left ( gErrorCode ; 2 ) = "$$" ] Beep Show Message [ An error occurred. ] End If
This will set the custom icon to the contents of the container field “gCustomIcon”.