DCSTATIC now has FORMATTED clause

This forum is for posting of useful information
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4775
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

DCSTATIC now has FORMATTED clause

#1 Post by rdonnay »

@ .. DCSAY and @ .. DCSTATIC will support a FORMATTED clause in build 255.

This allows for formatting of text as follows:

"\n" Defines a line break.
"\b" Enables bold type. Succeeding characters are
rendered using a bold font.
"\i" Enables italic type. Succeeding characters are
rendered using an italic font.
"\u" Enables underlined text. Succeeding characters are
rendered using an underlined font.
"\c" Cancels bold, italic and/or italic mode. Succeeding
characters are rendered using a plain (normal)
font.
"\t" Tab character. Display of succeeding characters
resumes at the next tab stop.

Here is a code example:

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], cText


TEXT INTO cText WRAP "\n" TRIMMED
   Test line with a few \bbold\c characters. A few
   chars in this line look \if\bunn\cy, too.

   \tThis line is indented, as is the next one.
   \t\uSee\c what I mean?

   All courtesy of the \b\uFORMATTED\c clause...

   Now is the time for all good men to come to the aid of their country.
   The quick red fox jumped over the lazy dog's back.
ENDTEXT

@ 0,0 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT SIZE 0 ;
     CAPTION cText FORMATTED ;
     FONT '12.Lucida Console' ;
     COLOR GRA_CLR_DARKRED, GRA_CLR_WHITE

DCREAD GUI FIT TITLE 'Formatted Text'

RETURN nil

* ----------

PROC appsys ; return
formatted.jpg
formatted.jpg (34.68 KiB) Viewed 7032 times
The eXpress train is coming - and it has more cars.

Post Reply