T_SETUP

Specify a text window’s characteristics

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
xcall T_SETUP(window_id, [D_INIT], [left_margin], [right_margin], [top_margin], 
&     [bottom_margin], [paragraph], [origin_row], [origin_col], [rows], [columns] 
&     [, option, ...])

window_id

The ID of the window that will be used. (n)

D_INIT

(optional) The flag to initialization the window. (n)

left_margin

(optional) The size (in columns) of the left margin (i.e., the offset from the left edge of the window). (n)

right_margin

(optional) The size (in columns) of the right margin (i.e., the offset from the right edge of the window). (n)

top_margin

(optional) The size (in rows) of the top margin (i.e., the offset from the top edge of the window). (n)

bottom_margin

(optional) The size (in rows) of the bottom margin (i.e., the offset from the bottom edge of the window). (n)

paragraph

(optional) Paragraph options of the form xy (a two-digit value), where x is the number of blank lines between paragraphs, and y is the number of spaces to indent a paragraph. If not specified, the number of blank lines and indent spaces default to zero. (n)

origin_row

(optional) The row at which the display area will begin. (n)

origin_col

(optional) The column at which the display area will begin. (n)

rows

(optional) The number of rows in the text window (i.e., the height of the display area). (n)

columns

(optional) The number of columns in the text window (i.e., the width of the display area). (n)

option

(optional) One or more of the following default load state flags: (n)

D_ATTR

Attributes. (See the Attribute Flag Definitions table below.)

D_COLOR

Color palette number.

D_KEEPLEADING

Keep interline spacing for a window.

D_NOKEEPLEADING

Remove interline spacing for a window. (default)

D_STRIP

Set trailing blank strip mode. (default)

D_NOSTRIP

Turn off strip mode.

D_WRAP

Set wrap mode. (default)

D_NOWRAP

Turn off wrap mode.

D_WRITES

Set WRITES mode.

D_NOWRITES

Turn off WRITES mode. (default)

T_SETUP configures a low-level Synergy window (created with W_PROC) as a text window and sets the window’s characteristics. You also can use this subroutine to reconfigure an existing general or input window as a text window. For example, you can use T_SETUP to change an input window into a text window (but you will lose all input fields).

All arguments except window_id are optional and are useful only if you’re going to be loading text into the window.

If D_INIT is specified, the window will be cleared and flagged as empty. If it is not specified, the window will not be cleared and is assumed to contain data. The number of text lines will be calculated by stripping all blank lines from the window.

Each margin argument (left_margin, right_margin, etc.) specifies how many columns or rows will be allotted to a margin, as measured from the window’s edge. This determines how much text can be entered in the window. For example, if you have a 30 by 30 window, but you set the margins in T_SETUP to 1,1,1,10, there will be 28 rows and 19 columns for text (30 minus 2 for the left and right margins, and 30 minus 11 for the top and bottom margins). Any omitted arguments default to zero. If the window is not initialized and you specify a margin, the text processing system assumes that there is no data within that margin. (Text in a margin will be unavailable for editing.)

The display area arguments (origin_row, origin_col, rows, and columns) determine how much of the window you can see (not how much text you can enter in the window, which is determined by the size of the window minus any margins.) If none of the display arguments are present, the display area for the window is used.

You can specify up to eight options. If specified modifiers conflict, the last one to be processed will take effect.

T_SETUP clears all attributes if D_ATTR is not set. (ATTR_LOAD is assumed. See Windowing routines.) If set, D_ATTR must be followed by one of the attribute flags listed in the following table. Each flag consists of a series of codes: B=blinking (italic on Windows), H=highlighted (bold), R=reverse, and U=underlined. Note that you can substitute I for B (for example, A_IR instead of A_BR). These are defined in tools.def.

Attribute Flag Definitions

Attribute flag

Definition

A_NONE

No attributes.

A_U

Underlined.

A_R

Reverse.

A_RU

Reverse, underlined.

A_B

Blinking (on Unix and OpenVMS) or italic (on Windows).

A_BU

Blinking, underlined.

A_BR

Blinking, reverse.

A_BRU

Blinking, reverse, underlined.

A_H

Highlighted.

A_HU

Highlighted, underlined.

A_HR

Highlighted, reverse.

A_HRU

Highlighted, reverse, underlined.

A_BH

Blinking, highlighted.

A_BHU

Blinking, highlighted, underlined.

A_BHR

Blinking, highlighted, reverse.

A_BHRU

Blinking, highlighted, reverse, underlined.

A_ALL

All attributes (same as A_BHRU).

D_COLOR must be followed by the color palette number (1-16). T_SETUP sets the color to 1 if D_COLOR is not set.

When entering T_EDIT or T_VIEW on Windows, D_KEEPLEADING prevents Toolkit from removing the interline spacing for a window. With T_EDIT, this may cause more rows of text to become visible than the display area of the window would dictate. D_NOKEEPLEADING restores default behavior: Toolkit removes interline spacing for a window, which makes the window vertically shorter. On Unix and OpenVMS, D_KEEPLEADING and D_NOKEEPLEADING are ignored.

The D_STRIP, D_NOSTRIP, D_WRAP, D_NOWRAP, D_WRITES, and D_NOWRITES options define the defaults for T_PUTTXT.

This example changes the low-level Synergy window “txtwnd” into a text window and initializes it. It will have the default text options.

xcall u_ldwnd(txtid, g_utlib, "txtwnd")
xcall t_setup(txtid, init)

The following example sets up the window specified by txtid. It will have a two-column left margin, there will be no paragraph indentation or spacing, the text will start two columns in from the upper left corner, and the display area will include 10 rows of 16 characters of text.

xcall t_setup(txtid,, 2, 0, 0, 0,, 1, 1, 10, 18)