[Previous] [Contents] [Index] [Next]

PtFontSel

A widget for selecting font attributes

Class hierarchy:

PtWidget --> PtBasic --> PtContainer --> PtFontSel

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 allows user selection of a font family, style, and size. It provides a combobox for selecting the family, an editable combobox for selecting the font size, and buttons for selecting bold, italic, and anti-aliased styles.


PtFontSel


A PtFontSel widget.


New resources:

Resource C type Pt type Default
Pt_ARG_FONT_DISPLAY unsigned Flag Pt_FONTSEL_ALL_FONTS
Pt_ARG_FONT_FLAGS unsigned Flag Pt_FONTSEL_SAMPLE |
Pt_FONTSEL_AA_CHECK
Pt_ARG_FONT_NAME char * String "helv12"
Pt_ARG_FONT_SAMPLE char * String "AaBbCcXxYyZz"
Pt_ARG_FONT_SYMBOL long Scalar 'A'
Pt_CB_FONT_MODIFY PtCallback_t * Link NULL

Pt_ARG_FONT_DISPLAY

C type Pt type Default
unsigned Flag Pt_FONTSEL_ALL_FONTS

Flags to filter the inclusion of font families in the selection dialog (see PtFontSelection() in the Photon Library Reference). These flags may be ORed together - the value Pt_FONTSEL_ALL_FONTS is provided to override this filtering:

Pt_ARG_FONT_FLAGS

C type Pt type Default
unsigned Flag Pt_FONTSEL_SAMPLE | Pt_FONTSEL_AA_CHECK

Flags to modify the appearance of the widget:

Pt_ARG_FONT_NAME

C type Pt type Default
char * String "helv12"

The name of the initial font. This resource also reflects the currently selected font.

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 which define this character are included. This resource may be used to display only Latin fonts (use 'A') or Cyrillic fonts (use Pk_Cyrillic_IO). The value Pt_FONTSEL_ALL_SYMBOLS may be used to override this filtering.

Pt_CB_FONT_MODIFY

C type Pt type Default
PtCallback_t * Link NULL

A list of callback functions invoked whenever the selected font is modified.

If the widget has the Pt_CALLBACKS_ACTIVE bit set in its Pt_ARG_FLAGS resource, this callback is also invoked when the selected font is changed by a call to PtSetResources().

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

reason
Pt_CB_FONT_MODIFY
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 PtContainer
Pt_ARG_ANCHOR_OFFSETS PtContainer
Pt_ARG_AREA PtWidget
Pt_ARG_BANDWIDTH_THRESHOLD PtBasic Not used by this class.
Pt_ARG_BITMAP_CURSOR PtWidget
Pt_ARG_BORDER_WIDTH PtWidget
Pt_ARG_BOT_BORDER_COLOR PtBasic
Pt_ARG_COLOR PtBasic
Pt_ARG_CONTAINER_FLAGS PtContainer &=~Pt_GETS_FOCUS
Pt_ARG_CURSOR_COLOR PtWidget
Pt_ARG_CURSOR_TYPE PtWidget
Pt_ARG_DATA PtWidget
Pt_ARG_DIM PtWidget See below.
Pt_ARG_EFLAGS PtWidget Pt_CONSUME_EVENTS
Pt_ARG_FILL_COLOR PtBasic
Pt_ARG_FILL_PATTERN PtBasic
Pt_ARG_FLAGS PtWidget 0
Pt_ARG_HELP_TOPIC PtWidget
Pt_ARG_HIGHLIGHT_ROUNDNESS PtBasic
Pt_ARG_MARGIN_HEIGHT PtBasic
Pt_ARG_MARGIN_WIDTH PtBasic
Pt_ARG_POS PtWidget
Pt_ARG_RESIZE_FLAGS PtWidget
Pt_ARG_TOP_BORDER_COLOR PtBasic
Pt_ARG_TRANS_PATTERN PtBasic
Pt_ARG_USER_DATA PtWidget
Pt_CB_ACTIVATE PtBasic
Pt_CB_ARM PtBasic
Pt_CB_BALLOONS PtContainer
Pt_CB_BLOCKED PtWidget
Pt_CB_DESTROYED PtWidget
Pt_CB_DISARM PtBasic
Pt_CB_FILTER PtContainer
Pt_CB_GOT_FOCUS PtBasic
Pt_CB_HOTKEY PtWidget
Pt_CB_LOST_FOCUS PtBasic
Pt_CB_MENU PtBasic
Pt_CB_RAW PtWidget
Pt_CB_REALIZED PtWidget
Pt_CB_REPEAT PtBasic
Pt_CB_RESIZE PtContainer
Pt_CB_UNREALIZED PtWidget
Pt_ARG_DIM
The dimension of the PtFontSel widget is fixed at 216 wide * 136 high (when the Pt_FONTSEL_SAMPLE bit of the Pt_ARG_FONT_FLAGS resource is set), or 216 wide * 58 high (when the Pt_FONTSEL_SAMPLE bit is clear).

Convenience functions:

The PtFontSel class defines the following convenience function:

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

[Previous] [Contents] [Index] [Next]