Views Studio Command File

The predefined Views Studio commands are declared in a command description file: studio.cmd. This file is located in the directory $ILVHOME/studio/data. You can declare your own commands directly in an .opt file or in a .cmd file and use the commandFile option in the .opt file to declare that file. Your command declaration file will be loaded after the supplied studio.cmd file. In your command declaration file, you can override declarations of predefined commands in order, for example, to modify labels or icons.

Command Properties

A Views Studio command is defined by the following set of properties:

  • label "<label>" lets you specify the label of the menu item when the command is attached to a menu. If the label is not specified, the command name is used. The specified label can be either a real string or a multilingual message identifier.

  • toggleLabel "<label>" is used for a command having a state, such as the TestDocument command. When the command is activated, this string becomes the label of the command tooltip. The specified label can be either a real string or a multilingual message identifier.

  • tooltip "<string>" is used to specify a string used to display the tooltip when the command is attached to a tool bar item or a gadget. By default, the tooltip simply displays the command label. The specified string can be either a real string or a multilingual message identifier.

  • toggleTooltip "<string>" is used for a command having a state, such as the TestDocument command. When the command is activated, the command tooltip displays this string. The specified string can be either a real string or a multilingual message identifier.

  • acceleratorText "<string>" is used when the command is attached to a menu item. Used to set up the menu item, it represents the accelerator key that executes the command.

  • acceleratorDefinition "<string>" is used when the command is attached to a menu item. The specified string is decoded and set to the menu item.

  • bitmap "<name>" is used when the command is attached to a tool bar. It lets you specify a bitmap name for the corresponding tool bar item.

  • prompt "<string>" lets you specify a single line string describing your command. The specified string can be either a real string or a multilingual message identifier. This string is displayed in the message area when the command menu item is highlighted or when its tooltip is activated.

  • togglePrompt "<string>" is used for a command having a state. It lets you specify a string to be used instead of the prompt string when the command is turned on.

  • messages <messageList> lets you specify one or more Views Studio messages to be broadcast when the command is executed.

  • interactive <true/false> tells whether the command is to appear in the Commands panel or not.

  • category <categoryName> lets you specify a category for the command. To specify more than one category for a command, use this option repeatedly. If the category you specify is not yet used, it is automatically created and displayed in the Commands panel.

  • selector "<name>" lets you specify a mutually exclusive selector for your command. This property is meaningful when the command can have a state. Only one command in the same selector can be selected at a time. If a command is selected, the previously selected command is automatically deselected.

Example

The following command file changes the label of the Quit command to Exit and defines an accelerator key for executing the CloseDocument command.

The corresponding command declarations are copied from the $ILVHOME/studio/data/studio.cmd file to /users/smith/mystudio.cmd.

command Quit {

label "^Exit"; // modified property

tooltip "&ttmenu_quit";

prompt "&quitEditor";

bitmap "icquit";

category studio;

}

 

command CloseDocument{

label "&mclose";

prompt "&closeDocumentP";

acceleratorText "F4"; // added property

acceleratorDefinition "<Key F4>"; // added property

category document;

}

The /users/smith/mystudio.opt file declares the above command file:

studio {

commandFile "/users/smith/mystudio.cmd";

}

If the /users/smith directory is in the ILVPATH environment variable, the full path of the mystudio.cmd file does not need to be specified:

studio {

commandFile "mystudio.cmd";

}

The ILVSTOPTIONFILE is set to /users/smith/mystudio.opt.