When defining a tool, it is possible to show a dialog to the user, asking for additional arguments, using the $PROMPT(filename) command-macro. The Free Pascal distribution contains some ready-made dialogs, such as a ’grep’ dialog, a ’cvs checkout’ dialog and a ’cvs check in’ dialog. The files for these dialogs are in the binary directory and have an extension .tdf.
In this section, the file format for the dialog description file is explained. The format of this file resembles a windows .INI file, where each section in the file describes an element (or control) in the dialog. An OK and a Cancel button will be added to the bottom of the dialog, so these should not be specified in the dialog definition.
A special section is the Main section. It describes how the result of the dialog will be passed to the command line, and the total size of the dialog.
Remark Keywords that contain a string value should have the string value enclosed in double quotes as in
The Main section should contain the following keywords:
means the dialog is 59 characters wide, and 9 lines high. This size does not include the border of the dialog.
A control placeholder is the name of some control in the dialog, enclosed in percent (%) characters. The name of the control will be replaced with the text associated with the control. Consider the following example:
Here the values associated with the controls named l, v, i, w and searchstr and filemask will be inserted in the command line string.
The following is an example of a valid main section:
After the Main section, a section must be specified for each control that should appear on the dialog. Each section has the name of the control it describes, as in the following example:
Each control section must have at least the following keywords associated with it:
Each control has some specific keywords associated with it; they will be described below.
A label (Type=Label) has the following extra keywords associated with it:
the T will be highlighted.
A label does not contribute to the text of the command line; it is for informational and navigational purposes only. The following is an example of a label description section:
An edit control (Type=InputLine) allows entry of arbitrary text. The text of the edit control will be pasted in the command line if it is referenced there. The following keyword can be specified in a inputline control section:
The following is an example of an input line section:
A checkbox control (Type=CheckBox) presents a checkbox which can be in one of two states, on or off. With each of these states, a value can be associated which will be passed on to the command line. The following keywords can appear in a checkbox type section:
The following is an example of a valid checkbox description:
If the checkbox is checked, then the value -i will be added on the command line of the tool. If it is unchecked, no value will be added.