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

PtBitmap

A bitmap

Class hierarchy:

PtWidget --> PtBasic --> PtBitmap

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

PhAB icon:

PtBitmap button in PhAB

Public header:

<photon/PtBitmap.h>

Description:

PtBitmap draws a bitmap. PtBitmap can be set, unset, or made unselectable. You can use it either in groups, button bars, menu bars, or as a single button.


PtBitmap


Bitmapped images.



Note: You must define a bitmap's dimensions via Pt_ARG_DIM before setting its Pt_ARG_BITMAP_DATA and Pt_ARG_SET_BITMAP_DATA resources. Once the bitmap's data has been specified, don't change the dimensions.

You must set the Pt_ARG_SET_BITMAP_COLORS resource prior to setting Pt_ARG_SET_BITMAP_DATA.


New resources:

Resource C type Pt type Default
Pt_ARG_BITMAP_BALLOON (PtWidget *)() Link NULL
Pt_ARG_BITMAP_BALLOON_COLOR PgColor_t Scalar Pg_BLACK
Pt_ARG_BITMAP_BALLOON_FILL_COLOR PgColor_t Scalar Pg_BALLOONCOLOR
Pt_ARG_BITMAP_BALLOON_POSITION unsigned short Scalar Pt_BITMAP_BALLOON_RIGHT
Pt_ARG_BITMAP_COLORS PgColor_t *, short Array NULL
Pt_ARG_BITMAP_DATA char **, short Array NULL
Pt_ARG_BITMAP_FLAGS short Flag 0
Pt_ARG_BITMAP_TEXT char * String NULL
Pt_ARG_BMP_SET_BG_COLOR PgColor_t Scalar Pg_GRAY
Pt_ARG_BMP_SET_BG_FILL unsigned char Scalar Pt_TRUE
Pt_ARG_SET_BITMAP_COLORS PgColor_t *, short Array NULL
Pt_ARG_SET_BITMAP_DATA char **, short Array NULL

Pt_ARG_BITMAP_BALLOON

C type Pt type Default
(PtWidget *)() Link NULL

By default, when a user pauses the pointer over this widget, the widget will display a small yellow balloon. If you want to change the look or default text of the balloon, you can use this resource to override the default value supplied by the default inflate function.

Here's a prototype of a sample inflate function:

PtWidget_t *InflateBalloon( PtWidget_t *window,
                            PtWidget_t *widget,
                            int position,
                            char *text,
                            char *font,
                            PgColor_t fill_color,
                            PgColor_t text_color );
        

where:

window
The parent of the widget requiring the balloon.
widget
The widget a balloon will be displayed over.
position
The balloon's position (see Pt_ARG_BITMAP_BALLOON_POSITION below).
text
The text to display (see Pt_ARG_BITMAP_TEXT below).
font
The font for the text.
fill_color
The fill color (see Pt_ARG_BITMAP_BALLOON_FILL_COLOR below).
text_color
The balloon-text color (see Pt_ARG_BITMAP_BALLOON_COLOR below).

In your function, you can either use the supplied values, or ignore them and use values of your own.

Pt_ARG_BITMAP_BALLOON_COLOR

C type Pt type Default
PgColor_t Scalar Pg_BLACK

The balloon's text color.

Pt_ARG_BITMAP_BALLOON_FILL_COLOR

C type Pt type Default
PgColor_t Scalar Pg_BALLOONCOLOR

The balloon's fill color.

Pt_ARG_BITMAP_BALLOON_POSITION

C type Pt type Default
unsigned short Scalar Pt_BITMAP_BALLOON_RIGHT

Indicates where the bitmap text will pop up. Possible values:

Pt_ARG_BITMAP_COLORS

C type Pt type Default
PgColor_t *, short Array NULL

An array of colors (1 for each bitplane). To set the number of bitplanes, use the len argument to the PtSetArg() macro.

You must set this resource prior to setting Pt_ARG_BITMAP_DATA.

Pt_ARG_BITMAP_DATA

C type Pt type Default
char **, short Array NULL

The bitmap data. Each bit represents a single pixel and each horizontal line must be rounded up to a multiple of 8 bits. For more information, see PgDrawBitmap(). To control the dimensions of the bitmap, use Pt_ARG_AREA or Pt_ARG_DIM.


Note: You must define a bitmap's dimensions via Pt_ARG_DIM before setting its Pt_ARG_BITMAP_DATA and Pt_ARG_SET_BITMAP_DATA resources. Once the bitmap's data has been specified, don't change the dimensions.

Pt_ARG_BITMAP_FLAGS

C type Pt type Default
short Flag 0

Possible values:

Pt_BITMAP_SHOW_BALLOON
If the pointer remains motionless for 1.25 seconds over the bitmap, pop up a balloon with the bitmap's text.

The default setting for this resource is 0; that is, no flags are set.

Pt_ARG_BITMAP_TEXT

C type Pt type Default
char * String NULL

The text string to display in the balloon.

Pt_ARG_BMP_SET_BG_COLOR

C type Pt type Default
PgColor_t Scalar Pg_GRAY

The background color that the widget uses when it becomes armed (that it, when it's pressed in). Pt_ARG_BMP_SET_BG_FILL must be set to Pt_TRUE for this resource to be used.

Pt_ARG_BMP_SET_BG_FILL

C type Pt type Default
unsigned char Scalar Pt_TRUE

Indicates whether or not Pt_ARG_BMP_SET_BG_COLOR will be used when the widget becomes armed. Possible values:

Pt_TRUE
Use the value of Pt_ARG_BMP_SET_BG_COLOR.
Pt_FALSE
Ignore the value of Pt_ARG_BMP_SET_BG_COLOR, and use Pg_TRANSPARENT instead.

Pt_ARG_SET_BITMAP_COLORS

C type Pt type Default
PgColor_t *, short Array NULL

An array of colors (1 for each bitplane). To set the number of bitplanes, use the len argument to the PtSetArg() macro.

You must set this resource prior to setting Pt_ARG_SET_BITMAP_DATA.

Pt_ARG_SET_BITMAP_DATA

C type Pt type Default
char **, short Array NULL

This resource defines the armed bitmap data. The format of the data is the same as in Pt_ARG_BITMAP_DATA (see above).


Note: You must define a bitmap's dimensions via Pt_ARG_DIM before setting its Pt_ARG_BITMAP_DATA and Pt_ARG_SET_BITMAP_DATA resources. Once the bitmap's data has been specified, don't change the dimensions.

You must set the Pt_ARG_SET_BITMAP_COLORS resource prior to setting Pt_ARG_SET_BITMAP_DATA.


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_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_CURSOR_COLOR PtWidget
Pt_ARG_CURSOR_TYPE PtWidget
Pt_ARG_DATA PtWidget
Pt_ARG_DIM PtWidget See below.
Pt_ARG_EFLAGS PtWidget
Pt_ARG_FILL_COLOR PtBasic
Pt_ARG_FILL_PATTERN PtBasic
Pt_ARG_FLAGS PtWidget
Pt_ARG_HELP_TOPIC PtWidget
Pt_ARG_HIGHLIGHT_ROUNDNESS PtBasic
Pt_ARG_MARGIN_HEIGHT PtBasic 1
Pt_ARG_MARGIN_WIDTH PtBasic 1
Pt_ARG_POS PtWidget
Pt_ARG_RESIZE_FLAGS PtWidget Not used by this class.
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_BLOCKED PtWidget
Pt_CB_DESTROYED PtWidget
Pt_CB_DISARM PtBasic
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_UNREALIZED PtWidget
Pt_ARG_DIM
You must define a bitmap's dimensions via Pt_ARG_DIM before setting its Pt_ARG_BITMAP_DATA and Pt_ARG_SET_BITMAP_DATA resources. Once the bitmap's data has been specified, don't change the dimensions.

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