Consultor Eletrônico



Kbase 12573: How to use the UIB to write TTY applications
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
How to use the UIB to write TTY applications

Using the UIB to write Character Applications

There are a few steps that a UIB user can follow if they want to
use the UIB to create character applications. However, there are
significant caveats in doing this.

Steps To Follow: Creating a Character Mode Application

1) Create a window that is a slightly larger than your ultimate
character environment. Remember not to include space for
MENU-BAR(1 line), MESSAGE-AREA (2 lines) and STATUS-AREA (1
line) in your calculation.

2) In the Window Attribute Editor, check the toggle for Suppress
Window Creation [TTY mode does not support new windows].

3) Remember that you want to work in a 1-character unit fixed-
font grid. You want to be in a situation of having a grid
that matches this font. You also want a font that allows 80
columns of work area. So:
i) Set up a 1 row by 1 column grid [ie. 1 PPU by 1 PPU]
ii) On all frames you create, choose a fixed font that
is about 1 column per character [This is not
required, but it can make the simulation more
realistic. NOTE: on Motif, the default font IS a
fixed font. Under Windows, the default fixed font is
1.2 PPUs wide] (Courier New 8 or 9 point works well).

4) Save your files. These files will run in a character mode
version

Caveats

1) In TTY, the menubar , message area, and status line subtract
from the usable area of the window. The UIB acts like GUI-
Progress and adds these areas to the size
2) The UIB has no place to store PFCOLOR or DCOLOR [Use BGCOLOR
and FGCOLOR instead ]
3) When sizing widgets, remember that the borders are going
to be different. For example: if you have a fill-in with
"X(8)", size the fill-in to be 8 columns because TTY has no
decoration (even though in GUI, this will only hold 6
characters). For other widgets, you should assume larger
borders when planning your layouts.

This is a list of the approximate border sizes (in PPUS) for
key widget types.

Widget Horizontal Border Vertical Border
TTY GUI TTY GUI
-------------------------------------------------
Fillins 0 1-2
Selection List 6 13 2 0-3
Editors 2 1-3 2 0-3
Toggle Boxes 3 4
Radio Sets 3 4
Frames 2 1-3 2 2-4


4) Remember that inner-lines map to about .5 PPU's in GUI but to
1 PPU in TTY. So multi-line widgets (editor and selection
lists) will look like they can hold twice as many items
(lines) as they would at run time.

Major Limitations

All UIB output is explicitly sized. This is not necessary for
character mode applications.

Porting Rectangles and Sliders is especially hard to visualize
because their graphic formats are so different between platforms

Can't but in a label with trailing spaces which is very useful for
buttons (or labels) eg " OK " which would create a button
< OK >

Progress Software Technical Support Note # 12573