Skip to main content

Dial_IconControl (function reference)

By November 1, 2020June 23rd, 2021Online Help, Troi Dialog Plug-in
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

switches this determines the behavior of the function
theIcon small JPG or PNG image to show at the left of the dialog

Switches

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

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:

$$-50 parameter error
$$-41 not 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 16 to 19

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 dialog functions: Dialog, ListDialog, InputDialog, BigInputDialog and FlashDialog.
NOTE: Version 8.0 added icons for Dial_ProgressBar function.

If you set the custom icon again the old one is deleted. To reset the icon use the -ForgetCustomIcon switch.

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

Used in example file

Input.fmp12

Related functionsFunction badge

Dial_BigInputDialog
Dial_Dialog
Dial_FlashDialog
Dial_InputDialog
Dial_ListDialog
Dial_ProgressBar

Related topics

Troi Dialog Plug-in online help (overview)


Online Help Page for Troi Dialog Plug-in for 16 to 19 –> Dial_IconControl (dialp4307) 2021-0623 15:51:14