PtBkgd

A color-gradient and image background

Class hierarchy:

PtWidgetPtBasicPtContainerPtBkgd

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

PhAB icon:

PtBkgd button in PhAB

Public header:

<photon/PtBkgd.h>

Description:

The PtBkgd widget provides a background of a color gradient with an optional image on top of it. The image can be tiled across the gradient.


PtBkgd


Several different styles of background widgets.

A PtBkgd widget is filled with a color gradient that's based on the widget's Pt_ARG_FILL_COLOR and Pt_ARG_CONTRAST (defined by PtBasic). For example, the background could start from dark blue at the top and gradually fade to light blue at the bottom.

On top of this gradient, you can display an image, defined by the Pt_ARG_BKGD_IMAGE resource. If the image is smaller than the PtBkgd widget, you can tile the image in various ways by setting Pt_ARG_BKGD_SPACING_X, Pt_ARG_BKGD_SPACING_Y, and Pt_ARG_BKGD_TILE.

New resources:

Resource C type Pt type Default
Pt_ARG_BKGD_IMAGE PhImage_t * Image NULL
Pt_ARG_BKGD_SPACING_X short Scalar 0
Pt_ARG_BKGD_SPACING_Y short Scalar 0
Pt_ARG_BKGD_TILE uint8_t Scalar Pt_BKGD_GRID

Pt_ARG_BKGD_IMAGE

C type Pt type Default
PhImage_t * Image NULL

A pointer to a PhImage_t structure that defines the image to be displayed. If it's NULL, no image is displayed. For more information, see PhImage_t and PxLoadImage() in the Photon Library Reference.

Set the flags member of the PhImage_t structure to:

Ph_RELEASE_IMAGE | Ph_RELEASE_PALETTE |
Ph_RELEASE_TRANSPARENCY_MASK | Ph_RELEASE_GHOST_BITMAP
      

before providing the image to the widget. If you do this, the memory used for the image is released when the widget is unrealized or destroyed.


Note: When you set this resource, the widget copies the PhImage_t structure but not the data pointed to by the members of the structure. After setting this resource, you can free() the PhImage_t if you don't need it, but don't free() the members of it.

Pt_ARG_BKGD_SPACING_X

C type Pt type Default
short Scalar 0

The horizontal spacing between tiles, in pixels.

Pt_ARG_BKGD_SPACING_Y

C type Pt type Default
short Scalar 0

The vertical spacing between tiles, in pixels.

Pt_ARG_BKGD_TILE

C type Pt type Default
uint8_t Scalar Pt_BKGD_GRID

This resource determines the type of tiling used to display the image. Possible values:

Pt_BKGD_CENTER
Draw the image once and center it within the container.
Pt_BKGD_CENTER_GRID
Center the image within the container and then, if the image is smaller than the container, tile the image around the outside.
Pt_BKGD_GRID
Repeat the image in grid fashion.
Pt_BKGD_NONE
Don't tile the image; just display it once in the upper left corner.

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_LEFT_ANCHORED_LEFT|
Pt_RIGHT_ANCHORED_LEFT|
Pt_TOP_ANCHORED_TOP|
Pt_BOTTOM_ANCHORED_TOP
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 0
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_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_LAYOUT_INFO PtContainer
Pt_ARG_FILL_PATTERN PtBasic
Pt_ARG_FLAGS PtWidget
Pt_ARG_GRID_LAYOUT_DATA PtWidget
Pt_ARG_GRID_LAYOUT_INFO PtContainer
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_LAYOUT_INFO PtContainer
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_RESIZE_XY_AS_REQUIRED
Pt_ARG_ROW_LAYOUT_DATA PtWidget
Pt_ARG_ROW_LAYOUT_INFO PtContainer
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