Dial_IconControl (function reference)

Troi Dialog Plug-in for FileMaker Pro

Dial_IconControl

Sets the custom icon, to be used in subsequent dialogs where the switch “-customIcon” is specified.

SyntaxFunction badge

Dial_IconControl ( switches ; theIcon )

Parameters

switchesthis determines the behaviour of the function
theIconsmall JPG or PNG image to show at the left of the dialog

Switches

Switches must be one of these:

-SetCustomIconsets the custom icon
-ForgetCustomIconforgets and frees the memory for the custom icon
-DefaultIconSize=48this will make it the default to show all icons at 48×48, without the need to set it for each dialog function call

Returned Result

Data type returned

Error code

Result

If successful it returns 0.
If unsuccessful it returns an error code starting with $$ and the error code. Returned error codes can be:

$$-50parameter error
$$-41not enough memory

Other errors may be returned. (See the OSErrrs database for more information on error codes).

Originated in

Troi Dialog Plug-in 1.2

Compatibility

FileMaker Pro 12 to 17

Considerations

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.

Example

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”.

Related functionsFunction badge

Dial_BigInputDialog
Dial_Dialog
Dial_FlashDialog
Dial_InputDialog
Dial_ListDialog

Related topics

Troi Dialog Plug-in online help (overview)


Online Help Page for Troi Dialog Plug-in for 14 to 17 –> Dial_IconControl (dialp4307) 2018-1114 15:05:13