DCL is an acronym for Dialog Control Language, a separate programming language that you can use with Bricscad to create custom dialog boxes. In creating dialog boxes with DCL, you work with elements called tiles, cluster tiles (or clusters), and attributes. The following sections describe each type of element and the basic syntax used to express it.
A tile is a dialog box element, such as a button, a text box, a list box, an image, or a piece of text. Tiles are typically expressed via the following syntax:
Note the colon prefix, followed by a space. That signifies that you are redefining (temporarily) the attributes of a tile. A tile name appearing without the colon prefix indicates that it has already been defined elsewhere (earlier in the DCL file or in another DCL file). The braces contain the tile's attributes (if any), characteristics such as color, associated action, or label.
Tiles are also categorized by function:
NOTES
A cluster is a group of tiles, such as a group of related radio buttons (also called option buttons) or a group of check boxes (also called toggles). Clusters are usually (but not always) surrounded by a rectangular outline. The individual tile elements within a cluster are called the cluster's children.
Clusters are a form of tile, and typically take the following syntax:
Again, note the colon prefix, followed by a space. The braces contain the cluster's attributes and tiles. Radio buttons have their own clusters since, by definition, there must be at least two radio buttons in a cluster.
In DCL, the term attribute refers to a characteristic of a tile, such as its color, the action it performs, its label, and so forth. The program's DCL includes a number of predefined Predefined Attributes(IDR_2) (for example, color, multiple_select, and typeface).
A tile can have many attributes or none at all. When a tile has no attributes, it assumes the default values of the attributes.
A typical attribute takes the following syntax:
Note the semicolon terminator. Not all attributes apply to all tiles. In fact, some attributes change their meaning, depending on the tile with which they are used.
The program's DCL has one unique tile and several attributes that are not found in other implementations of DCL. The following table describes the tile unique to Bricscad's implementation of DCL:
Tile | Meaning |
---|---|
: multi_edit_box { } | Creates a multi-line edit box. |
The following table summarizes the attributes that are unique to Bricscad's implementation of DCL:
Attribute | Meaning |
---|---|
lower_only = flag; | Read all input text as lower case. |
pointsize = int; | Point size of text displayed by the dialog box. |
read_only - flag; | Text in edit box is non-editable. |
typeface = "string"; | TrueType typeface displayed by the dialog box. |
upper_only = flag; | Read all input text as upper case. |
A DCL file is in ASCII format, so you can use any text editor (such as Microsoft® NotePad or Microsoft® Word) to write and edit DCL files.
Line comments are prefixed with //, as follows:
To embed comments in the DCL code, use /* and */, as follows:
The DCL file can reference tile definitions in anther DCL file through the use of the include directive:
Tell me about...
Copying Code Examples from the Bricscad Programmer’s Reference
Bricscad™ is commercialized by Bricsys NV. Bricsys NV and Vondle NV are fully owned subsidiaries of Menhirs NV. © 2001- Menhirs NV - All rights reserved. |