t = GetIconProperties(id) type, tooltypes, deftool$ = GetIconProperties(file$)
There are two ways of using this function: You can either pass the
identifier of an icon in the first parameter or the filename of an icon file.
Passing a filename to GetIconProperties() is only supported on
AmigaOS and compatibles, passing an icon identifier is supported
on all platforms however.
If you choose to pass the identifier of an icon in the first parameter,
GetIconProperties() will return a table that has the following fields
initialized:
Type:
#AMIGAICON_DISK:
#AMIGAICON_DRAWER:
#AMIGAICON_TOOL:
#AMIGAICON_PROJECT:DefaultTool, e.g. SYS:Utilities/MultiView.
#AMIGAICON_GARBAGE:
##AMIGAICON_DEVICE:
#AMIGAICON_KICKSTART:(V9.0)
IconX:
IconY:
DrawerX:Type is set to a container type like #AMIGAICON_DRAWER,
this tag will be set to the x position of the new window that
will be opened when double-clicking the icon. (V9.0)
DrawerY:Type is set to a container type like #AMIGAICON_DRAWER,
this tag will be set to the y position of the new window that
will be opened when double-clicking the icon. (V9.0)
DrawerWidth:Type is set to a container type like #AMIGAICON_DRAWER,
this tag will be set to the width of the new window that
will be opened when double-clicking the icon. (V9.0)
DrawerHeight:Type is set to a container type like #AMIGAICON_DRAWER,
this tag will be set to the height of the new window that
will be opened when double-clicking the icon. (V9.0)
ViewAll:Type is set to a container type like #AMIGAICON_DRAWER,
this tag will be set to True if all files of the drawer should
be shown instead of just the ones that have an icon. (V9.0)
StackSize:Type is set to #AMIGAICON_TOOL or #AMIGAICON_PROJECT,
the desired stack size for the program to be launched. (V9.0)
DefaultTool:Type is set to #AMIGAICON_PROJECT, this will be set to
a string containing name (and optionally path) of the program to
open the file with. (V9.0)
ToolTypes:ToolTypes tag will contain a table that contains a list
of subtables, one subtable per tooltype entry. Each subtable will
contain the following tags:
Key:
Value:
Enabled:
Alternatively, you can also get the tooltypes by using the
RawToolTypes tag (see below).
(V9.0)
RawToolTypes:ToolTypes tag for some reason, you
can also use RawToolTypes to get them. In contrast to ToolTypes,
the RawToolTypes tag doesn't divide tooltypes into their individual
constituents (key, value, enabled flag). Instead, the RawToolTypes
tag will just return the tooltypes as they are stored in the icon,
i.e. without any additional processing. This makes it possible to
get custom data stored in tooltypes as well. RawToolTypes will be
set to a table that contains the tooltypes as strings. (V9.0)
Images:
Width:
Height:
Standard:True if the image is the standard image, False otherwise.
Frames:(V9.0)
To set the properties of an icon, use the SetIconProperties() command.
Key, Value, and Enabled initialized#AMIGAICON_PROJECT
t = GetIconProperties(1)
For k = 0 To ListItems(t.ToolTypes) - 1
DebugPrint("Item:", k, "Key:", t.ToolTypes[k].key,
"Value:", t.ToolTypes[k].value,
"Enabled:", t.ToolTypes[k].enabled)
Next
The code above gets the properties of icon 1 and then prints all
information stored in its tooltypes.
type, tt, deftool$ = GetIconProperties("MyIcon.info")
For k = 0 To ListItems(tt) - 1
DebugPrint("Item:", k, "Key:", tt[k].key, "Value:", tt[k].value,
"Enabled:", tt[k].enabled)
Next
The code above gets the properties of the icon "MyIcon.info" and
then prints all information stored in its tooltypes.