TBX
Title Box Definition File (TBX file)


A TBX file is used to define the creation of title boxes on a drawing frame. It is a simple line-oriented ASCII text file containing a file descriptor and the following parts:

  • Frame setup overrides statements
  • TAG definitions
  • FIELD definitions
  • BOX definitions (containing ROW definitions)

The ordering of these definitions are irrelevant; however, forward reference is not allow. It is therefore recommended to place these object definition statements in the above listing order.

Note that all text lines that start with a ';' (semicolon) will be taken as comment line.

File Descriptor

The first three lines of a TBX file may contain informations about the TBX file. Each line must start with ';*' character sequence to be identified as valid file descriptor.

The content of the first line after the ';*' codes specifies the display name of this TBX file. DDFRAME takes whatever after the ';*' codes as the description of the file. If it is empty or the TBX file does not contain a valid file descriptor, DDFRAME will take its filename instead.

The content of the second line specifies the language support required by the TBX file. If this line is missing, or the language code is 0, the checking of the language support will be ignored. That is, it will be used by DDFRAME whatever the language codes it contains. Note that, the language code can be given in hex-decimal value in the form as "0xhhhh".

The third line contains the version code of the TBX file specification. As the development of DDFRAME, the specification of the TBX file may be expanded. This version code is necessary for the DDFRAME to check if it can fully support this TBX file. If this line is missing, the checking will be ignored.

An example of the file descriptor is given below:

;* CNS 3, B1001 Example
;* 0x0404
;* V1.0

Frame Setup Overrides

Frame setup overrides are statements that specify the basic layout of the frame, as described below:

MARGIN Statement

The MARGIN statement setups the required margin of the drawing frame. The syntax is given below:

MARGIN: "Paper-name",left,top,right,bottom

where

Paper-name     Name of the paper. An asterisk ('*') means the values shall apply to all size of the papers.

left     Left margin value, floating point, in units of mini-meter.

top     Top margin value, floating point, in units of mini-meter.

right     Right margin value, floating point, in units of mini-meter.

bottom     Bottom margin value, floating point, in units of mini-meter.

Examples are given below:

MARGIN: "*",10,10,10,10
MARGIN: "A0",15,15,15,15
MARGIN: "A1",15,15,15,15
MARGIN: "A2",15,15,15,15
MARGIN: "A5",5,5,5,5
MARGIN: "A5-P",5,5,5,5

BORDER Statement

The BORDER statement setups the required frame border style of the drawing frame. The syntax is given below:

BORDER: "Paper-name",Type, W1 , D1, W2

where

Paper-name     Name of the paper. An asterisk ('*') means the values shall apply to all size of the papers.

Type     Type of the border, string constant of either SINGLE or DOUBLE.

W1     Line width of the first border line, floating point in units of mini-meter.

D1     Distance between the first border line and the second border line, floating point in units of mini-meter.

W2     Line width of the second border line, floating point in units of mini-meter.

Examples are given below:

BORDER: "*", Double, 0, -6., 0.5
BORDER: "A0", Double, 0, -10., 0.5
BORDER: "A1", Double, 0, -8., 0.5

MARKER Statement

The MARKER statement specifies the usage of partition marker of the drawing frame. The syntax is given below:

MARKER: "Paper-name", Th, Hdiv, Vdiv

where

Paper-name     Name of the paper. An asterisk ('*') means the values shall apply to all size of the papers.

Th     Text height, floating point in units of mini-meter. If this value is negative, the partition marker is turned off.

Hdiv     Division number of horizontal partitioning, integer. If it is negative, it means to mark with capital letter; otherwise, mark with digital number.

Vdiv     Division number of vertical partitioning, integer. If it is negative, it means to mark with capital letter; otherwise, mark with digital number.

Examples are given below:

MARKER: "*",5.0, 8, -6
MARKER: "A0",7.0, 20, -14
MARKER: "A1",7.0, 14, -10
MARKER: "A2",7.0, 12, -8
MARKER: "A5",4.0,6,-4
MARKER: "A5-P",4.0,4,-6

GAP Statement

The GAP statement specifies the default gap distance between text and field boundary. The syntax is given below:

GAP: "Paper-name", gap

where

Paper-name     Name of the paper. An asterisk ('*') means the values shall apply to all size of the papers.

gap     Gap distance between text and field border, floating point. If it is positive, it specifies absolute gap distance in units of mini-meter. If it is negative, it specifies the relative gap distance in terms of the percentage of the field height.

An examples is given below:

GAP: "*",-5

SCALE Statement

The SCALE statement specifies the required scale factor of the title box in the drawing frame. The syntax is given below:

SCALE: "Paper-name", scale

where

Paper-name     Name of the paper. An asterisk ('*') means the values shall apply to all size of the papers.

scale     Scale factor of the title box dimension, floating point.

An examples is given below:

SCALE: "*",1.0

TAG Definitions

The TAG definitions are optional in a TBX file. They are used to define the attributes of tags used in the TBX file and supply each of them a more expressive prompting string, which may help the operator to identify the meaning of the tag when he is asked to modify or to enter its contents.

The defining syntax is as below:

TAG: Tag-name,{D,}{V,} "prompting string"

It is the same as that appears in a TAG file produced by TAGOUT command. See TAGIN/TAGOUT command reference for the details about this TAG definition. In fact, you may use the preprocessing statement

#include "tag-file"

to include a TAG file. DDFRAME will automatically skip the GROUP definitions and load the TAG definitions therein.

Note that if a tag name is referenced without a corresponding TAG definition in the TBX file, DDFRAME will assume that it is a variable and visible attribute tag, and its name will be used as the prompting string.

FIELD Definitions

The FIELD definitions are used to define the details of the text fields which are referenced in the ROW definitions that appear only in the BOX definitions. A field can be

  • An empty field containing nothing, or
  • A static text field containing a fix text string, or
  • An attribute tag field containing an attribute tag to display variable text information, or
  • A combination of a static text string used as the field display title and an attribute tag as the actual field content.

A FIELD definition must be completed within a text line. The general form of a FIELD definition is given below:

FIELD: Field-name, parameters ...

where Field-name is the ID name of the field.

Static Text Field

The syntax for a static text field is as below:

FIELD: Field-name,"text" {,Tadj}

where

text     Static text string as the field content. If text string within the pair of parenthesis is empty, then it is effective an empty field.

Tadj     Optional Text justification code. It must be one of the following characters:

L     Base-left justified.
C     Base-center justified.
R     Base-right justified.
E     Even-fitting within the field.
F     Direct fitting within the field.

An optional code string "90" can be added after the justification code to specify a vertical writing text.

Examples are given below:

FIELD: EMPTY,""
FIELD: COMPANY,"TCAM DEVELOPMENT HOUSE",F

Attribute Tag Field

The syntax for an attribute tag field is as below:

FIELD: Field-name, Tag-name ,Tadj, "Content"

where

Tag-name     Name of the attribute tag used in the field. If the specific TAG is not defined, it will be assumed to have both visible and variable attributes.

Tadj     Text justification code.

Content     Initial default value of the tag's content.

Examples are given below:

FIELD: OWNER,OWNER,C,"XXX"
FIELD: TITLE,TITLE,C,"XXX"

Combination Field

The syntax for a combination field is as below:

FIELD: Field-name, Tag-name ,Tadj, "Content", Wt, "Title",Txadj

where

Tag-name     Name of the attribute tag used in the field.

Tadj     Text justification code of the tag.

Content     Initial default value of the tag.

Wt     Integer, title text field width specifier. If this value is positive, the field will be divided into two sub-fields horizontally, and the title text will be placed within the left one. The value specifies the width of the title sub-field in units of percentage of the total field width. A vertical line will be added for the separation of the two sub-fields.

If this value is negative, the field will be divided into two sub-fields vertically, and the title text will be placed within the top one. The value specifies the height of the title sub-field in units of percentage of the field height. Note that, however, no additional line will be added to separate the two sub-fields explicitly.

Title     Static field title string.

Txadj     Text justification code of the title text.

Examples are given below:

FIELD: DESIGN,DESIGNEDBY,L,"XXX",-50,"Designed By",L
FIELD: CHECK,CHECKEDBY,L,"XXX",-50,"Checked By",L
FIELD: EDITION,EDITION,L,"0",-50,"Edition",L
FIELD: SHEET,SHEET,L,"1/1",-50,"Sheet",L

BOX Definitions

The Box definitions defines the generation of the title boxes in the frame. You may have several BOX definitions within a TBX files.

The general syntax of a BOX definition is given below:

BOX: Name, Ancho{/box-name}, Dir, Height, Width
  '{'
     Row Specification
     ...
     Row Specification
  '}'

where

Name     Name of the box being defined. Since a box may be referenced by other boxes to obtain ancho position, a unique name must be given.

Ancho     Ancho point ID number, from 0 to 3, as listed below:

0     Ancho to its lower left corner.
1     Ancho to its lower right corner.
2     Ancho to its upper right corner.
3     Ancho to its upper left corner.

/box-name     Optional name of the box to ancho. The slash code ('/') is necessary to introduce the name of the box to ancho. If it missing, the overall drawing frame is assumed.

Dir     Direction of the box extended from the ancho point, as described below:

0     Extended to the first quadrant.
1     Extended to the second quadrant.
2     Extended to the third quadrant.
3     Extended to the fourth quadrant.

Height     Integer, absolute height of the box, in units of mini-meter. If this value is zero, the height of the box will not be limited and will be the total height of each containing rows. However, if this value is not zero, the height of each containing row will be scaled such that the total box height meets the value.

Width     Integer, absolute width of the box, in units of mini-meter. In current release, this value can not be zero.

    A single left brace in the next line after BOX statement introduces the content of the box.

Row Specification     Specification of a row within the BOX. Multiple row specifications must appear in a BOX definition in a from-top-to-bottom manner. See latter section for details of ROW specification.

    A single right brace at the end of the last row specification concludes the definition of a BOX.

Special Box Definition

If no ancho point is given after the box name, then the overall drawing frame will be the targeted box to define and will be treated specially. Rows in the box will be scaled to fit within the frame. This is useful in customization of drawing frame decoration.

An example is given below:

BOX: FRAME
{
      ROW: 1,@isoframe
}

The box will be the overall drawing frame; however, the outer profile of the box will not be drawn out, since it is treated specially. There is only one ROW specification in the box, so that the height of the row will be the height of the drawing frame. There is only one field specification in the row, so that the width of the field will be the width of the drawing frame. The vector generation program ISOFRAME.VEC (written in TCL) is referenced by the field to do the drawing frame decoration.

ROW Specification

A ROW specification specifies the existence of a row and defines its content within a BOX definition. The syntax of a ROW specification is given below:

ROW: Height, Field-Spec,...,Field-Spec

where

Height     Integer, height of the row in the box. The actual height of the row depends on the height specification of the BOX. If the BOX height is limited to an absolute value, the height of the row will be scaled accordingly.

Field-Spec     Specification of a field. It can be a direct static text, a field reference, an external VEC file reference, or a nested box inclusion. See latter paragraph for details.

Field Specifications

The field specification specifies the existence of a field in a ROW from a BOX. It can be in one of the following form:

  • Direct Text:
    "Text"{/Width{Tadj}}
  • Field Reference:
    Field-name{/Width{Tadj}}
  • External Vector Generation:
    @vec-name{/Width{Tadj}}
  • Nested Box Inclusion:
    '{'{/Width{Tadj}}
    Row Specification
    ...
    Row Specification
    '}'{, next Field-spec continued

where

Text     Direct text string, enclosed in parenthesis, to be displayed in the field. It is convenient to use direct text than a reference to the FIELD definition of static text. However, except the ROW containing fields of nested box inclusion, a ROW specification can not span over a text line, which can have at most 255 characters in length. In some title box designs with long rows, you may still need to use the FIELD definitions of static text.

Field-name     Name of an existing FIELD definition. The FIELD must be present before it is referenced.

vec-name     Name of the vector generation file (a special TCL program in VEC file extension) to be executed to give the content of the field.

Width     Integer, width of the field within the row. If this value is negative, it specifies the percentage of the row width. If it is zero or missing, it specifies to take up the rest of the row space, effective only when it is the last field in the row.

Tadj     Text justification code override. See FIELD Definitions for text justification code format.

    Start of a nested box inclusion. The next line should be the content of the nested box definition.

}     End of a nested box inclusion and continue the current ROW definition.

Examples are given below:

FIELD: NOTE,"Title/Name, Designation, material, dimension etc",L
BOX: Main,1,1,0,170
{
   ROW: 6,"Itemref"/15C,"Quantity"/17C,NOTE/88L,"Article No/Reference"/50L
   ROW:12,DESIGN/32,CHECK/25,APPROV/33,FILENAME/25,DATE/30,SCALE/20
   ROW: 20,OWNER/75,{/
        ROW: 10,TITLE
        ROW: 10,DWGNO/60,EDITION/15,SHEET
        }
}

Conditional Statements

DDFRAME supports the following conditional statements in the TBX file:

  • #ifpaper -- Test if a specific paper is selected. An argument of quoted string as the name of paper to test must be given. If the test is successful, the contents that follows the statement will be effectively loaded in; otherwise, it will be ignored until the next conditional statement is encountered.
  • #ifnot -- Test if a specific paper is not selected. An argument of quoted string as the name of paper to test must be given. If the test is successful, the contents that follows the statement will be effectively loaded in; otherwise, it will be ignored until the next conditional statement is encountered.
  • #else -- If the previous test is not successful, then the contents that follows this statements are loaded in until the next conditional statement is encountered.
  • #endif -- End of the if-then-else construct.

Include statements

You may include an external file, such as TAG file, from the TBX file by the syntax:

#include "filename"

where filename is the name of the file to include.

The VEC file (vector generation file)

A vector generation file is a TCL program file that is responsible to generate a vector drawing fitted within a given rectangle defined by the caller, say DDFRAME.

It is called with the arguments passed through the TCL registers:

P1     Lower left corner of the rectangle.
P2     Upper right corner of the rectangle.
I0     Justification code if applicable.
V0     Gap distance of Text.
V1     Total scale factor.
S0     ID code, always be "VEC".
S1     Current selected paper name.

goback.gif (1545 bytes)