Consultor Eletrônico



Kbase P169329: MESSAGE VIEW-AS ALERT-BOX shows unexpected line breaks in Windows Vista/Windows 7
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/26/2010
Status: Verified

SYMPTOM(s):

MESSAGE VIEW-AS ALERT-BOX shows unexpected line breaks in Windows Vista/Windows 7

Message box that uses SKIP displays properly under Windows XP but not under Windows Vista or Windows 7

Message box that displays CHARACTER variable containing linefeed characters displays properly under Windows XP but not under Windows Vista or Windows 7

Under Windows Vista or Windows 7 the text is wrapped prior to the SKIP and then the next line contains the rest of the text from the first line followed by the SKIP

FACT(s) (Environment):

Windows XP
Windows Vista
Windows 7
OpenEdge 10.x

CAUSE:

The MESSAGE ... VIEW-AS ALERT-BOX relies on the standard Windows message boxes to display the message. Microsoft changed the rules for laying out message boxes under Windows Vista and Windows 7, compared to Windows XP.

Windows XP makes no attempt to wrap long lines of text automatically, and breaks lines only if there are linefeed characters in the message string. This can result in very wide message boxes when there was a long line of text in the message, which become hard to read as a result. Because of this many customers implemented their own word wrapping by using the SKIP phrase.

In Windows Vista and Windows 7 the rules have changed, and the message boxes do insert line breaks automatically if a line becomes too long. The basic rule is that most message boxes are the same width. They only get wider if there is enough text to make the message box taller than it is wide, in that case they widen the message box so the width is greater than the height; this exception does not take into account explicit line breaks.
To accomplish this, line breaks are inserted at the 64th character of a line, or on the last space before the 64th character.

FIX:

In most cases, there is no longer a need to wrap the message text yourself to keep the box from being too wide. For these cases, if you are running only on Windows Vista (or later, including Windows 7) you should simply remove the SKIP phrase and let the text wrap by itself.

If removing the SKIP phrases causes the message to be too long on Windows XP, change the location of the linefeed (SKIP phrase or linefeed characters) so that they appear before every 64th character in a line.