Progress
Portability Guide


Character Units and Pixels

A character unit is a basic unit of measure equal to the height of a fill-in widget, and the width of an average character in the default system font. This unit of measure is used wherever you use ROW, COLUMN, HEIGHT, WIDTH, SPACE, and SKIP syntax, regardless of the font setting for the frame you are defining. You can express a character unit as a decimal value, up to two decimal places. Precision beyond that is ignored. In character environments, Progress rounds decimals to integer values.

CAUTION: In character interfaces, Progress rounds the decimal character unit values up or down to the nearer integer, which might cause widgets to overlap.

Progress lets you plan your window layout either in pixels or in character units. For better portability between displays, use character units to specify size and location values. Using pixels is the least portable way to define widgets because specifying pixels ties your code to one resolution on one platform and makes the code unusable on character-mode platforms. Character units assist in porting graphical applications to character mode.

The default size of a fill-in widget is one character unit in height. The default width is eight characters. Character-based platforms work with fixed character units only. On Windows, the default system font is proportional. This can lead to truncation of text in some fill-in fields. Therefore, if you do not specify a font for a fill-in field or its parent frame on Windows, Progress uses the following guidelines to determine the size of the widget when you use a display format that does not contain fill characters (such as dashes in an identification number):

If you specify a display format that contains fill characters (such as the parentheses surrounding the area code of a telephone number), the font defaults to fixed:

DEFINE VARIABLE mychar AS CHARACTER FORMAT "XXX-XX-XXXX". 

The size of a character unit is based on the default font. Recompiling is not necessary for different displays on the same platform (for example, with Windows on monitors with different resolutions).


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095