A bitmap
PtWidget --> PtBasic --> PtBitmap
For more information, see the diagram of the widget hierarchy.
<photon/PtBitmap.h>
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.
Bitmapped images.
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. |
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 |
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:
In your function, you can either use the supplied values, or ignore them and use values of your own.
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_BLACK |
The balloon's text color.
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_BALLOONCOLOR |
The balloon's fill color.
C type | Pt type | Default |
---|---|---|
unsigned short | Scalar | Pt_BITMAP_BALLOON_RIGHT |
Indicates where the bitmap text will pop up. Possible values:
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.
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.
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. |
C type | Pt type | Default |
---|---|---|
short | Flag | 0 |
Possible values:
The default setting for this resource is 0; that is, no flags are set.
C type | Pt type | Default |
---|---|---|
char * | String | NULL |
The text string to display in the balloon.
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.
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:
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.
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).
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. |
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.