Consultor Eletrônico



Kbase 18478: Window Displays Only 80 chars Even if Width Equals 132 chars
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2008
Status: Verified

FACT(s) (Environment):

Progress 4GL

SYMPTOM(s):

Window Displays Only 80 chars Even if Width Equals 132 char

CAUSE:

When using the DISPLAY statement with a frame WIDTH of 132 characters,
at runtime the frame may appear with a view port that is only 80 characters wide, and a scrollbar. This can be due to the fact that the frame has been defined using a proportional font rather than a fixed font.

FIX:

This solution describes two ways to get rid of the scrollbar and obtain a display of the full 132-character frame width.

1) Use fixed fonts rather than proportional fonts. The means by which PROGRESS calculates frame width is based on the size of the font being used in the frame. Proportional fonts introduce problems based on the varying width of the characters, thereby affecting the size of the displayed frame. Fixed fonts avoid this problem.

2) If proportional fonts must be used, then it will be necessary to increase the number of characters in the frame definition.

The example below demonstrates this approach:

DEFINE VARIABLE C-Win AS HANDLE.
DEFINE VARIABLE x AS char FORMAT "X(160)".

CREATE WINDOW C-Win ASSIGN WIDTH = 160.
CURRENT-WINDOW = C-Win.

THIS-PROCEDURE:CURRENT-WINDOW = C-Win.
CURRENT-WINDOW:width-char = 180.

x="12345678911234567892123456789312345678941234567895123456789612345678123456789 81234567899123456789101234567891112345678912123456789e".

display x with width 180.
VIEW C-Win.
WAIT-FOR GO OF CURRENT-WINDOW.