PtFontSel

A widget for selecting font attributes

Class hierarchy:

PtWidgetPtBasicPtContainerPtFontSel

For more information, see the diagram of the widget hierarchy.

PhAB icon:

PtFontSel button in PhAB

Public header:

<photon/PtFontSel.h>

Description:

The PtFontSel widget lets you select font attributes.


PtFontSel


A PtFontSel widget.

A PtFontSel widget lets you select the:

The PtFontSel shows sample text that reflects the current font format choices.

New resources:

Resource C type Pt type Default
Pt_ARG_FONT_DISPLAY unsigned short Flag Pt_FONTSEL_ALL_FONTS
Pt_ARG_FONT_FLAGS unsigned short Flag Pt_FONTSEL_SAMPLE | Pt_FONTSEL_AA_CHECK
Pt_ARG_FONT_LBL_BKGDCOLOR char * String "Bkgd:"
Pt_ARG_FONT_LBL_FONT char * String "Font:"
Pt_ARG_FONT_LBL_SIZE char * String "Size:"
Pt_ARG_FONT_LBL_STYLE char * String "Style:"
Pt_ARG_FONT_LBL_TEXTCOLOR char * String "Text:"
Pt_ARG_FONT_NAME char * String "TextFont09"
Pt_ARG_FONT_POINT_SIZE_MAX long Scalar 9999
Pt_ARG_FONT_SAMPLE char * String "AaBbCcXxYyZz"
Pt_ARG_FONT_SYMBOL long Scalar 'A'
Pt_ARG_FONT_TEXT_COLOR PgColor_t Scalar Pg_BLACK
Pt_ARG_FONT_TEXT_BKGD_COLOR PgColor_t Scalar Pg_WHITE
Pt_CB_FONT_MODIFY PtCallback_t * Link NULL

Pt_ARG_FONT_DISPLAY

C type Pt type Default
unsigned short Flag Pt_FONTSEL_ALL_FONTS

Flags to filter the inclusion of font families in the selection dialog (see PtFontSelection() in the Photon Library Reference). You can OR these flags together:

You can use Pt_FONTSEL_ALL_FONTS to override this filtering.

Pt_ARG_FONT_FLAGS

C type Pt type Default
unsigned short Flag Pt_FONTSEL_SAMPLE | Pt_FONTSEL_AA_CHECK

Flags to modify the appearance of the widget:

Pt_ARG_FONT_LBL_BKGDCOLOR

C type Pt type Default
char * String "Bkgd:"

The label for the background color.

Pt_ARG_FONT_LBL_FONT

C type Pt type Default
char * String "Font:"

The label beside the combo box for choosing the font.

Pt_ARG_FONT_LBL_SIZE

C type Pt type Default
char * String "Size:"

The label used beside the font-size field.

Pt_ARG_FONT_LBL_STYLE

C type Pt type Default
char * String "Style:"

The label used beside the Style combo box.

Pt_ARG_FONT_LBL_TEXTCOLOR

C type Pt type Default
char * String "Text:"

The label for the text color.

Pt_ARG_FONT_NAME

C type Pt type Default
char * String "TextFont09"

The name of the initial font. This resource also reflects the currently selected font, style, quality, and size.

Pt_ARG_FONT_POINT_SIZE_MAX

C type Pt type Default
long Scalar 9999

The maximum point size the font selector allows, with a maximum of 9999. If this resource is set to a size that is smaller than the current font size, the current size is set to the new maximum.

Pt_ARG_FONT_SAMPLE

C type Pt type Default
char * String "AaBbCcXxYyZz"

The string to be used as a sample display of the font (if the Pt_FONTSEL_SAMPLE flag is set).

Pt_ARG_FONT_SYMBOL

C type Pt type Default
long Scalar 'A'

A character used to filter the inclusion of font families in the selection dialog. Only those fonts that define this character are included.

You can use this resource to display only Latin fonts (set it to 'A') or Cyrillic fonts (set it to Pk_Cyrillic_IO). You can use the value Pt_FONTSEL_ALL_SYMBOLS to override this filtering.

Pt_ARG_FONT_TEXT_COLOR

C type Pt type Default
PgColor_t Scalar Pg_BLACK

The color of the text. See PgColor_t in the Photon Library Reference.

Pt_ARG_FONT_TEXT_BKGD_COLOR

C type Pt type Default
PgColor_t Scalar Pg_WHITE

The background color of the text. See PgColor_t in the Photon Library Reference.

Pt_CB_FONT_MODIFY

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the selected font is modified.

If the widget has the Pt_CALLBACKS_ACTIVE bit set in its Pt_ARG_FLAGS resource, these callbacks are also invoked when your application changes the selected font by calling PtSetResource() or PtSetResources().

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_FONT_MODIFY
event
A pointer to a PhEvent_t structure that describes the event that caused the callback to be invoked.
cbdata
A pointer to the name of the new font selection.

These callbacks should return Pt_CONTINUE.

Inherited resources:

If the widget modifies an inherited resource, the “Default override” column indicates the new value. This modification affects any subclasses of the widget.

Resource Inherited from Default override
Pt_ARG_ANCHOR_FLAGS PtWidget
Pt_ARG_ANCHOR_OFFSETS PtWidget
Pt_ARG_AREA PtWidget
Pt_ARG_BANDWIDTH_THRESHOLD PtBasic Not used by this class.
Pt_ARG_BASIC_FLAGS PtBasic
Pt_ARG_BEVEL_WIDTH PtWidget
Pt_ARG_BITMAP_CURSOR PtWidget
Pt_ARG_BEVEL_COLOR PtBasic
Pt_ARG_BEVEL_CONTRAST PtBasic
Pt_ARG_COLOR PtBasic
Pt_ARG_CONTAINER_FLAGS PtContainer &=~Pt_GETS_FOCUS
Pt_ARG_CONTRAST PtBasic
Pt_ARG_CURSOR_COLOR PtWidget
Pt_ARG_CURSOR_OVERRIDE PtContainer
Pt_ARG_CURSOR_TYPE PtWidget
Pt_ARG_DARK_BEVEL_COLOR PtBasic
Pt_ARG_DARK_FILL_COLOR PtBasic
Pt_ARG_DATA PtWidget
Pt_ARG_DIM PtWidget
Pt_ARG_EFLAGS PtWidget
Pt_ARG_EXTENT PtWidget
Pt_ARG_FILL_COLOR PtBasic
Pt_ARG_FILL_PATTERN PtBasic
Pt_ARG_FLAGS PtWidget 0
Pt_ARG_GRID_LAYOUT_DATA PtWidget
Pt_ARG_HEIGHT PtWidget
Pt_ARG_HELP_TOPIC PtWidget
Pt_ARG_HIGHLIGHT_ROUNDNESS PtBasic
Pt_ARG_INLINE_COLOR PtBasic
Pt_ARG_LAYOUT_DATA PtWidget
Pt_ARG_LIGHT_BEVEL_COLOR PtBasic
Pt_ARG_LIGHT_FILL_COLOR PtBasic
Pt_ARG_MARGIN_HEIGHT PtBasic
Pt_ARG_MARGIN_WIDTH PtBasic
Pt_ARG_MAXIMUM_DIM PtWidget
Pt_ARG_MINIMUM_DIM PtWidget
Pt_ARG_OUTLINE_COLOR PtBasic
Pt_ARG_POINTER PtWidget
Pt_ARG_POS PtWidget
Pt_ARG_RESIZE_FLAGS PtWidget
Pt_ARG_ROW_LAYOUT_DATA PtWidget
Pt_ARG_STYLE PtBasic
Pt_ARG_TITLE PtContainer
Pt_ARG_TITLE_FONT PtContainer
Pt_ARG_TRANS_PATTERN PtBasic
Pt_ARG_USER_DATA PtWidget
Pt_ARG_WIDTH PtWidget
Pt_CB_ACTIVATE PtBasic
Pt_CB_ARM PtBasic
Pt_CB_BALLOONS PtContainer
Pt_CB_BLOCKED PtWidget
Pt_CB_CHILD_ADDED_REMOVED PtContainer
Pt_CB_CHILD_GETTING_FOCUS PtContainer
Pt_CB_CHILD_LOSING_FOCUS PtContainer
Pt_CB_DESTROYED PtWidget
Pt_CB_DISARM PtBasic
Pt_CB_DND PtWidget
Pt_CB_FILTER PtWidget
Pt_CB_GOT_FOCUS PtBasic
Pt_CB_HOTKEY PtWidget
Pt_CB_IS_DESTROYED PtWidget
Pt_CB_LOST_FOCUS PtBasic
Pt_CB_MENU PtBasic
Pt_CB_OUTBOUND PtWidget
Pt_CB_RAW PtWidget
Pt_CB_REALIZED PtWidget
Pt_CB_REPEAT PtBasic
Pt_CB_RESIZE PtContainer
Pt_CB_UNREALIZED PtWidget

Convenience functions:

The PtFontSel class defines the following convenience function:

PtFontSelection()
Display a modal dialog for selecting a font. See the Photon Library Reference.