Vertical or horizontal increment/decrement buttons
PtWidget --> PtBasic --> PtContainer --> PtUpDown
For more information, see the diagram of the widget hierarchy.
<photon/PtUpDown.h>
The PtUpDown widget creates vertical or horizontal increment/decrement buttons. It lets you increase or decrease a value.
A PtUpDown widget.
By default, the buttons display images of arrows, but you can use other images if necessary. You can also specify the armed data, the image displayed when the user presses one of the buttons.
The Pt_CB_ACTIVATE,Pt_CB_ARM, Pt_CB_DISARM, and Pt_CB_REPEAT callbacks for the buttons have a subtype that indicates which button was pressed.
Resource | C type | Pt type | Default |
---|---|---|---|
Pt_ARG_UPDOWN_ARM_DATA_BOTTOM | void * | Pointer | NULL |
Pt_ARG_UPDOWN_ARM_DATA_LEFT | void * | Pointer | NULL |
Pt_ARG_UPDOWN_ARM_DATA_RIGHT | void * | Pointer | NULL |
Pt_ARG_UPDOWN_ARM_DATA_TOP | void * | Pointer | NULL |
Pt_ARG_UPDOWN_BOTTOM_BORDER_COLOR | PgColor_t | Scalar | Pg_DGRAY |
Pt_ARG_UPDOWN_DATA_BOTTOM | void * | Pointer | NULL |
Pt_ARG_UPDOWN_DATA_LEFT | void * | Pointer | NULL |
Pt_ARG_UPDOWN_DATA_RIGHT | void * | Pointer | NULL |
Pt_ARG_UPDOWN_DATA_TOP | void * | Pointer | NULL |
Pt_ARG_UPDOWN_FILL_COLOR | PgColor_t | Scalar | Pg_GRAY |
Pt_ARG_UPDOWN_FLAGS | long | Scalar | See below |
Pt_ARG_UPDOWN_HIGHLIGHT_ROUND | unsigned short | Scalar | 0 |
Pt_ARG_UPDOWN_MARGIN_HEIGHT | unsigned short | Scalar | 0 |
Pt_ARG_UPDOWN_MARGIN_WIDTH | unsigned short | Scalar | 0 |
Pt_ARG_UPDOWN_ORIENTATION | int | Scalar | Pt_VERTICAL |
Pt_ARG_UPDOWN_SPACING | unsigned | Scalar | 0 |
Pt_ARG_UPDOWN_TOP_BORDER_COLOR | PgColor_t | Scalar | Pg_WHITE |
C type | Pt type | Default |
---|---|---|
void * | Pointer | NULL |
An image (of type PhImage_t - see the Photon Library Reference) to display for the buttons when they're pressed in.
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. |
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_DGRAY |
The color of the outermost bottom and right borders.
C type | Pt type | Default |
---|---|---|
void * | Pointer | NULL |
Images (of type PhImage_t - see the Photon Library Reference) to display for the buttons. The default images are arrows.
Set the image's flags as described for Pt_ARG_UPDOWN_ARM_DATA_BOTTOM. |
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_GRAY |
The background color.
C type | Pt type | Default |
---|---|---|
long | Scalar | Pt_HIGHLIGHTED | Pt_GETS_FOCUS |
These flags specify the appearance of the outermost borders:
Use the
Pt_ARG_FLAGS
resource to change the appearance of the inner borders.
Only the following flags are supported for this widget:
|
C type | Pt type | Default |
---|---|---|
unsigned short | Scalar | 0 |
The roundness of the outermost borders.
C type | Pt type | Default |
---|---|---|
unsigned short | Scalar | 0 |
The amount of vertical space between the outermost border and the inner images.
C type | Pt type | Default |
---|---|---|
unsigned short | Scalar | 0 |
The amount of horizontal space between the outermost border and the inner images.
C type | Pt type | Default |
---|---|---|
int | Scalar | Pt_VERTICAL |
The direction the arrows are pointing:
C type | Pt type | Default |
---|---|---|
unsigned | Scalar | 0 |
The distance, in pixels, between the buttons.
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_WHITE |
The color of the outermost top and left borders.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.
ulong_t reason; ulong_t reason_subtype; PhEvent_t *event; void *cbdata;
The callbacks are similar to those for PtButton, except the reason_subtype indicates which button was pressed: