PreviousNextIndex

SYSTEM-DIALOG FONT statement


(Windows only; Graphical interfaces only)

Displays a dialog box that allows the user to select and associate a system font with the specified font number. The SYSTEM-DIALOG FONT statement provides a dialog box appropriate to the graphical environment in which it runs.

Note: Does not apply to SpeedScript programming.
Syntax

SYSTEM-DIALOG FONT font-number 
  [ ANSI-ONLY ]  
  [ FIXED-ONLY ] 
  [ MAX-SIZE point-size ] 
  [ MIN-SIZE point-size ] 
  [ UPDATE logical-variable ]  
  [ IN WINDOW window ] 

font-number
ANSI-ONLY
FIXED-ONLY
MAX-SIZE point-size
MIN-SIZE point-size
UPDATE logical-variable
IN WINDOW window
Example

The following procedure displays a dialog box that allows the user to change the font of either its radio set or its buttons. The radio set lists a font number for each selection: font 1 for the radio set and font 2 for the buttons. Choosing the OK button opens a font dialog to assign a new system font to the font number selected in the radio set. Note that the UPDATE option is not used to return a termination status because the dialog does not require the user to select a new font; it only provides the option. The procedure terminates when the user chooses the Cancel button.

r-fntdlg.p
DEFINE VARIABLE Font1      AS INTEGER NO-UNDO INITIAL 1. 
DEFINE VARIABLE Font2      AS INTEGER NO-UNDO INITIAL 2. 
DEFINE VARIABLE FontSelect AS INTEGER NO-UNDO INITIAL 1 
  VIEW-AS RADIO-SET RADIO-BUTTONS "Font 1", 1, "Font 2", 2 FONT Font1. 
DEFINE BUTTON bOK     LABEL "OK" FONT Font2. 
DEFINE BUTTON bCANCEL LABEL "Cancel" FONT Font2 AUTO-ENDKEY. 
FORM 
  SKIP(0.5) SPACE(0.5) 
  FontSelect SPACE(2) bOK SPACE(2) bCANCEL 
  SPACE(0.5) SKIP(0.5) 
  WITH FRAME fFont TITLE "Choose frame fonts ..." VIEW-AS DIALOG-BOX. 
ON CHOOSE OF bOK IN FRAME fFont DO: 
  IF INTEGER(FontSelect:SCREEN-VALUE IN FRAME fFont) = Font1 THEN 
    SYSTEM-DIALOG FONT Font1. 
  ELSE 
    SYSTEM-DIALOG FONT Font2. 
END. 
UPDATE FontSelect bOK bCANCEL WITH FRAME fFont. 

Note: The CHOOSE OF OK event trigger must reference the SCREEN-VALUE attribute of the FontSelect variable to obtain the latest value selected for its radio set. This is because the UPDATE statement has not yet completed during the event, and has not updated the FontSelect record buffer from the frame buffer. The initial value of FontSelect is its value in the record buffer immediately before the UPDATE statement executes.
Notes

OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex