WINDOW SHAPE
Draw Shape in Thoroughbred Basic Window
This directive provides the inherent ability of the WINDOW series of directives to make borders by allowing the programmer to specify boxes or lines within Thoroughbred Basic Windows without restricting access to any part of the Thoroughbred Basic Window.
Syntax
Section titled “Syntax”WINDOW SHAPE ( BOX, width, height, col1, row1 ) [attributes]
WINDOW SHAPE (LINE, direction, col1, row1, length)BOX- is a keyword specifying that the SHAPE to be defined is a standard box.
width- is any positive integer in the range of 0 to the maximum number of columns in the Thoroughbred Basic Window, designating the total width of the box, including the border. If width is 0 or 1, the shape is a line rather than a box.
height- is any positive integer in the range of 0 to the maximum number of rows in the Thoroughbred Basic Window, designating the total height of the box, including the border. If height is 0 or 1, the shape is a line rather than a box.
col1- is any positive integer in the range of 0 to the maximum number of columns in the Thoroughbred Basic Window minus 1, designating the leftmost Thoroughbred Basic Window column where this shape is to be drawn.
row1- is any positive integer in the range of 0 to the maximum number of rows in the Thoroughbred Basic Window minus 1, designating the topmost Thoroughbred Basic Window row where this shape is to be drawn.
attributes- describe any additional aspects of the box such as title, border type, initialization, etc. The general format for attributes is "KEYWORD=value" as described in the REMARKS section below.
LINE- is a keyword specifying that the SHAPE to be defined is a standard line (line graphic characters).
direction- specifies the direction, or orientation, of the line. The options for direction are described in REMARKS.
length- is any positive integer in the range of 1 to the maximum number of columns or rows in the Thoroughbred Basic Window (depending upon the line direction), designating the total length of the line.
Remarks
Section titled “Remarks”This directive is generally available starting with release level 8.1.
Starting with release 8.2, the color setting attributes “INITCOLOR=” and
“BORDERCOLOR=” can have a number value from 0 to 255 as in the Thoroughbred Basic Window directive WINDOW COLOR. Similarly, the attributes “INITATR=” and “BORDERCOLOR=” can have a number value from 0 to 15 as in the Thoroughbred Basic Window directive WINDOW ATTR provided the attribute is supported by the setting.
If you use this directive but Thoroughbred Basic Windows is not enabled, an ERR=70 results. For information on how to enable Thoroughbred Basic Windows, please refer to the information on TCONFIG files and IPL files in the chapter on System Files in the Thoroughbred Basic Customization and Tuning Guide.
If this task is configured for Thoroughbred Basic Windows, only the standard set of Thoroughbred Basic terminal mnemonics should be used to send output to the terminal. Using direct hexadecimal escape sequences to control the terminal screen may cause the Thoroughbred Basic Windows Manager to lose knowledge of cursor position and character attributes. For more information on terminal mnemonics, please refer to the Thoroughbred Basic Customization and Tuning Guide.
The direction of the LINE is specified using one of the following keywords:
HORIZONTAL
VERTICAL
The format for attributes is:
Keyword- Description
"BORDER="- describes the border style:
NONE = no border
LG = line graphics box; default
CHAR x = use the character x as the border
CLEAR = defines a border of space characters
"BORDERATR="- sets the attributes of the border:
NV = normal video; default
RV = reverse video
BL = blink
FG = foreground
BG = background
Attributes may be compounded,
e.g., RV+BL+BG = reverse video, blink, background
"TITLE="- the title to be placed in the top border row; default is no title.
"TITLEAT="- positions the title within the top border row:
LEFT = left justified; default
CENTER = centered
RIGHT = right justified
"INIT="- describes how to initialize the area within the box:
NONE = performs no initialization; default
CHAR x = fills the box with the character x
CLEAR = space fills the box;
"INITATR="- describes the initial attributes of the area within the box:
NV = normal video; default
RV = reverse video
BL = blink
FG = foreground
BG = background
Attributes may be compounded,
e.g., RV+BL+BG = reverse video, blink, background
"INITCOLOR="- Describes the initial color of the area within the Thoroughbred Basic Window. The following are the values used for this attribute:
BACKGR = The color following this value is the background color. If there is no color following this value, then the background color is set to the current background color. Similarly, if the background color is the only one set, then the foreground color is set to the current foreground color.
Color values are: BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LGRAY, GRAY, LBLUE, LGREEN, LCYAN, LRED, LMAGENTA, YELLOW AND WHITE. e.g. BACKGR=RED+YELLOW
“BORDERCOLOR=” sets the color of the border. The following are the values used
for this attribute:
BACKGR = the color following this value is the background color. If there is no color following this value, then the background color is set to the current background color. Similarly, if the background color is the only one set, then the foreground color is set to the current foreground color.
Color values are: BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LGRAY, GRAY, LBLUE, LGREEN, LCYAN, LRED, LMAGENTA, YELLOW AND WHITE. e.g. BACKGR=RED+YELLOW
As stated above, the general format for attributes is “KEYWORD=value”. Multiple attributes can be chained into a single string bounded by quotes (” “) and separated by the vertical bar symbol (called the “pipe” symbol in UNIX), “|”. A reverse video, line graphics border could then be represented by the following attribute list (with no embedded spaces):
"BORDER=LG | BORDERATR=RV".Allowance is also made for use of a separator other than the vertical bar symbol. If the attribute string starts with SEP=character, then that character is interpreted as the separator. Using the example just given, the following string creates the same effect, using the exclamation mark (“!”) as the separator (again with no embedded spaces):
"SEP= ! BORDER=LG ! BORDERATR=RV"Examples
Section titled “Examples”WINDOW SHAPE (LINE, HORIZONTAL,0, 12,79)draws a horizontal line across the middle of the screen, dividing the top from the bottom.
WINDOW CREATE ( 40, 12, 20, 6 ) "BORDER=CLEAR", "BORDERATR=RV","TITLE=MESSAGES...", "TITLEAT=LEFT"
WINDOW SHAPE ( BOX, 38, 10, 1, 1 ) "BORDER=CLEAR", "BORDERATR=RV+BL","TITLE=WARNING", "TITLEAT=CENTER"The first directive creates a Thoroughbred Basic Window with reverse video, a steady border and the title MESSAGES… left-justified in the top border. The second directive builds a box, just inside the border of the Thoroughbred Basic Window, with blinking reverse video and the centered title of WARNING.
See also
Section titled “See also”Other WINDOW directives
Additional WIN functions
From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF