FontDialog
Object List Hierarchy Next Object
Definition:
Lists the fonts and font options that a user can select from to determine the
appearance of text. Available fonts vary from system to system.
Specialized Features:
The following tables list and describe the properties and methods that are
added by FontDialog. There are no added events.
Properties Use to...
AllowEffects Control whether the “Effects” section of the common dialog is visible.
AllowFaceSelect Control whether the FaceName textbox is enabled.
AllowSizeSelect Control whether the Size comboxbox is enabled.
AllowStyleSelect Control whether the Style combobox is enabled.
Bold Indicate whether Bold is part of the Style indicated by the Style combobox.
Color Set the default or indicate the value of the color combobox.
FaceName Set the default or indicate the value of the Face Name textbox.
Font Specify an Phoenix font that will configure the default settings for the
dialog and be reconfigured if the OK button is clicked.
Italic Indicate whether Italic is part of the Style indicated by the Style combobox.
LimitSize Control whether size must be within SizeMin and SizeMax.
OnlyAnsi Control whether Face Name choices are limited to Ansi fonts.
OnlyFixedPitch Control whether Face Name choices are limited to fixed pitch fonts.
OnlyTrueType Control whether Face Name choices are limited to TrueType fonts.
Size Set the default or indicate the value of the Size combobox.
SizeMax Determine the maximum size that can be chosen if LimitSize is True.
SizeMin Determine the minimum size that can be chosen if LimitSize is True.
Strikethru Set the default or indicate the value of the Strikeout checkbox.
Underline Set the default or indicate the value of the Underline checkbox.
Methods Use to...
Execute Display the FontDialog modally.
Copied Features:
Properties Methods Events
Details:
The FontDialog displays a dialog that gathers information from the user about
a font choice. By setting the values of the dialog’s checkboxes and textboxes, the user can indicate the face name and point size
of a font, and whether or not it should be underlined, bold, italic, or drawn
with a line through it (strikethru).
The appearance and default values of the dialog can be controlled by setting
the values of FontDialog’s properties prior to displaying the font dialog. The font dialog is displayed
by executing the font dialog's Execute method. The properties AllowEffects,
AllowFaceSelect, AllowStyleSelect, and AllowSizeSelect control whether the
portions of the dialog devoted to specifying these characteristics of a font will be
active when the dialog is posted. The properties Strikethru, Underline, Color,
Bold, Italic, FaceName, and Size can be set to desired defaults prior to
posting. The properties OnlyAnsi, OnlyTrueType and OnlyFixedPitch can be used to
restrict the range of FaceName choices presented to the user. Finally, if LimitSize
is set to True, then the user's Size choices will be limited to the inclusive
range defined by SizeMin and SizeMax.
FontDialog’s Execute method displays the dialog modally, which means the user must either
choose a font or else dismiss the dialog before directing input to any other
part of the user interface. If the user selects a font successfully, Execute
will return IDOK. In the event the user dismisses the dialog, Execute will return
IDCANCEL. After Execute returns, the user’s font choices will be reflected in the values of the properties Strikethru,
Underline, Color, Bold, Italic, FaceName, and Size.
As an alternative to working with the font dialog’s individual options, an Phoenix Font can be assigned to the dialog’s Font property. The dialog will then be configured according to the values of
the Font’s values for Strikethru, Underline, Color, Bold, Italic, FaceName, and Size.
In the event that the user makes a font choice during Execute (so that Execute
returns IDOK), the Font will be automatically reconfigured to reflect the user’s choices.
Because size and style attributes differ for each font, you should specify the
FaceName before setting other font attributes. The font attributes you set
must actually exist for a particular face, or they are invalid.