Consultor Eletrônico



Kbase P123946: How is the window size calculated from DefaultFont?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/29/2009
Status: Verified

GOAL:

How is the window size calculated from DefaultFont?

GOAL:

How does Progress calculate the window size depending on the font?

GOAL:

How is the size of a window determined?

GOAL:

What is the relation between window size and font?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

The size of a window is determined by the number of columns (WIDTH-CHARS) and the number of rows (HEIGHT-CHARS). The number of pixels in a column (SESSION:PIXELS-PER-COLUMN) and the number of pixels in a row (SESSION:PIXELS-PER-ROW) are determined when the session starts. These values are calculated based on the DefaultFont setting in the .ini file.
Example 1)
DefaultFont=Ms Sans Serif, size=8
The following values are calculated:

SESSION:PIXELS-PER-ROW = 21
SESSION:PIXELS-PER-COLUMN = 5
Example 2)
DefaultFont=FixedSys
The following values are calculated:

SESSION:PIXELS-PER-ROW = 24
SESSION:PIXELS-PER-COLUMN = 8
To calculate the window's size in pixels:
win1:HEIGHT-PIXELS = SESSION:PIXELS-PER-ROW * win1:HEIGHT-CHARS.
win1:WIDTH-PIXELS = SESSION:PIXELS-PER-COLUMN * win1:WIDTH-CHARS.
Assuming a window that is 80 columns (WIDTH-CHARS) wide by 22 rows (HEIGHT-CHARS ) tall:

For example 1, the window size will be: 400 pixels wide and 462 pixels tall.
For example 2, the window size will be: 640 pixels wide and 528 pixels tall.
Progress was designed this way so that windows, frames, and widgets will automatically scale up and down when the DefaultFont is changed. If this behavior is undesirable it is possible to write the code using pixel attributes (WIDTH-PIXELS, HEIGHT-PIXELS) instead of character attributes (WIDTH-CHARS, HEIGHT-CHARS). Pixel values do not scale when the DefaultFont changes.