Monday, May 5, 2008

Window Title Bars:

Real estate on windows can be tight enough, without having to worry about adding the title in the window. Using the WDWTITLE keyword in you DDS allows you to put the title of the window directly in the border of the window itself.

Here's an example:
A R WINDOW
A WINDOW(5 10 13 50 *NOMSGLIN)
A WDWTITLE((*TEXT ' Window Title ') *LEFT)
A 12 2'F6=Fold/Unfold'
A DSPATR(HI)
A 12 19'F12=Cancel'
A DSPATR(HI)

This can also work with a variable as the title text. Just place a variable in your WDWTITLE keyword in place of the text in quotes. For example, &TITLE. Your variable needs to be defined in the DDS as a program to system variable.
A R WINDOW
A WINDOW(1 2 22 75 *NOMSGLIN)
A WDWTITLE((*TEXT &TITLE) *LEFT)
A TITLE R P REFFLD(MYFORMAT/MYFIELD *LIBL/MYFILE)
A 21 2'F12=Cancel'
A DSPATR(HI)
A COLOR(BLU)

The Last parameter is where do you want the title to appear. *LEFT means it's left justified, *RIGHT is right justified, and *CENTER is Centered.

Just a note, this doesn't show up in SDA.

No comments: