Consultor Eletrônico



Kbase P15964: How to get the font attributes after calling the SYSTEM-DIALOG FONT statement.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/4/2004
Status: Unverified

GOAL:

How to get the font attributes after calling the SYSTEM-DIALOG FONT statement.

FACT(s) (Environment):

Progress 9.1x

FIX:

You can get the attributes of the chosen font by writing it to the registry and then reading it back. Please see the following example that illustrates this method.

/* Define variables */
DEFINE VARIABLE n AS INTEGER NO-UNDO.
DEFINE VARIABLE c AS CHARACTER NO-UNDO. /* Take care of the maximum number of fonts to create a dummy font */
n = FONT-TABLE:NUM-ENTRIES.
MESSAGE n VIEW-AS ALERT-BOX INFO BUTTONS OK.
FONT-TABLE:NUM-ENTRIES = n + 1. /* Display the Font dialog window */
SYSTEM-DIALOG FONT n. /* Write the chosen font attributes to the registry and read them back */
PUT-KEY-VALUE FONT n.
GET-KEY-VALUE SECTION "fonts" KEY "font" + string(n) VALUE c.
MESSAGE c VIEW-AS ALERT-BOX INFO BUTTONS OK. /* Cleanup */
PUT-KEY-VALUE SECTION "fonts" KEY "font" + string(n) VALUE ?.
FONT-TABLE:NUM-ENTRIES = n.