WDWTITLE (Window Title) keyword for display files

You use this record-level keyword to specify the text, color, and display attributes for a title that is embedded within the top or bottom border of a window.

The format of the keyword is:
WDWTITLE([title-text] [title-text-color]
[title-text-display-attribute]
[*CENTER | *LEFT | *RIGHT]
[*TOP | *BOTTOM])

At least one parameter must be specified.

The title-text parameter is an optional parameter which specifies the text that will be placed in the border of the window. The length of the text should be less than or equal to the window-positions parameter of the associated WINDOW definition record. If blanks are placed at the beginning of the text string, the title will be shortened so there are a equal number of blanks at the end. If the text string is too long (> window-positions), it will be truncated on the right. The parameter is specified as an expression of the form (*TEXT value) where value can be specified in one of two forms:
  • As a character string: 'Title text '
  • As a program-to-system field: &field-name

The field-name specified must exist in the window record and must be defined as a character field with usage P.

Notes:
  1. A GRAPHIC literal should not be used for the title-text parameter.
  2. If the title characters are blanks, then a blank title will be displayed.
  3. If the title characters are nulls, then no title will be displayed.

The title-text-color specifies the color of the title text on a color display. The parameter is specified as an expression of the form (*COLOR value).

The valid values for the title-text-color parameter are:
Value
Meaning
BLU
Blue
GRN
Green
WHT
White
RED
Red
TRQ
Turquoise
YLW
Yellow
PNK
Pink

If the title-text-color parameter is not specified, it is set to the color of the border as default. The parameter is ignored if it is specified for a window on a noncolor display.

The title-text-display-attribute specifies the display attributes of the title text. The parameter is specified as an expression in the form (*DSPATR [value1 [value2 [value3...]]]). If more than one DSPATR is used, they are combined to form one DSPATR that is used for the title text.

The valid values for the title-text-display-attribute values are:
Value
Meaning
BL
Blink
CS
Column separator
HI
High intensity
ND
Nondisplay
RI
Reverse image
UL
Underline

If the title-text-display-attribute parameter is not specified, it is set to the text attribute of the border as default.

If neither the title-text-color nor title-text-display-attribute parameter is specified, the window border will flow up to the first character of the window title and resume immediately after the last character. If either parameter is specified, there will be a space immediately before and after the window title.

The *CENTER/*LEFT/*RIGHT parameter specifies whether the window title should be aligned to the CENTER, LEFT or RIGHT of the window border. If not specified, the window title will be aligned in the CENTER of the window border if the next parameter is *TOP or to the LEFT of the window border if the next parameter is *BOTTOM.

The *TOP/*BOTTOM parameter specifies if the text should be imbedded in the top or bottom border. If not specified, the text will be placed in the top border.

Notes:
  • Not all controllers support alignment. On those controllers that do not, the title is centered.
  • If *BOTTOM is specified on an enhanced controller that does not support text in the bottom windows border, the WDWTITLE keyword is ignored.
  • By specifying ENHDSP(*NO) on the CRTDSPF or CHGDSPF command, the *BOTTOM, *LEFT, and *RIGHT parameters always work. However, all the other enhanced user interface functions are lost.

Option indicators are valid for this keyword.

The WDWTITLE keyword can only be specified on a record that contains a WINDOW keyword (in the definition format). If a WINDOW keyword that references another window is also specified, a warning message is issued.

You can specify more than one WDWTITLE on a record. If you specify the WDWTITLE keyword more than once at the record level, the parameters for the keywords that are in effect are combined. If different values are specified for the same parameter, the parameter value of the first keyword is used.

Example

The following example shows how to specify the WDWTITLE keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A
     A          R RECORD1                   WINDOW(6 15 9 30)
     A N01                                  WDWTITLE((*TEXT &TTL1) (*COLOR GRN))
     A  01                                  WDWTITLE((*TEXT &TTL1) (*COLOR RED))
     A            FIELD1         5A  B  2  2
     A            FIELD2        20A  B  8  5
     A            TTL1          10A  P
     A
     A          R RECORD2                   WINDOW(8 20 9 30)
     A                                      WDWTITLE((*TEXT &TTL2) +
     A                                               (*COLOR YLW) +
     A                                               (*DSPATR RI))
     A            FIELD3         5A  B  2  2
     A            FIELD4        20A  B  8  5
     A            TTL2          10A  P
     A

If the window defined by RECORD1 is written to the display, it will have whatever text is contained within TTL1 imbedded within the top border of the window. If indicator 01 is set off, this text will be green. If indicator 01 is set on, the text will be red.

When the window defined by RECORD2 is written to the display, the text contained within TTL2 will be imbedded within the top border of the window. This text will be display in reverse image and yellow.