Previous Next Chapter

ICON command

Purpose:

This command is for manipulating the icons displayed in a window.

Format:

ICON [WINDOW] <Window name> <Icon name> .. <Icon name> [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP <Pixels>] [DOWN <Pixels>] [LEFT <Pixels>] [RIGHT <Pixels>] [X <Horizontal position>] [Y <Vertical position>] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]

Template:

ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K

Parameters:

WINDOW

Name of the window whose icons should be manipulated. This can be ROOT" to work on the Workbench root window (where volume icons and AppIcons live), ACTIVE" to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.

If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.

NAMES

Names of the icons to manipulate.

OPEN

Specifies that the named icons should be opened.

MAKEVISIBLE

Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.

SELECT

Select the named icons.

UNSELECT

Unselect the named icons.

UP, DOWN, LEFT, RIGHT

Move the named icons by the specified number of pixels.

X, Y

Move the named icons to the specified position.

ACTIVATE

This command is for activating the icon closest to the currently selected icon in the window. Activating" in this context means selecting an icon, whilst at the same time unselecting all others". Thus, the active" icon is the only selected icon in the window.

You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. UP" searches upwards, DOWN" searches downwards, LEFT" searches to the left and RIGHT" searches to the right.

CYCLE

This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what active" means in this context, see the ACTIVATE" description above). You must indicate in which direction you want to cycle through the icons: you can either specify PREVIOUS" or NEXT".

MOVE

This command is not for moving icons but for moving through a file system hierarchy. Thus, moving in" will open a drawer and moving out" will open the drawer`s parent directory. The IN" parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The OUT" parameter will open the drawer`s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the Open Parent" menu item.

Errors:

10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.

Result:

-

Example:

/* Select the icons of the Workbench" and Work" volumes * displayed in the root window. */
ADDRESS workbench

ICON WINDOW root
NAMES Workbench Work SELECT

/* Open the Workbench" volume icon displayed in the root * window. */
ICON WINDOW root
NAMES Workbench OPEN

Top Previous Next Chapter