PtUpDown
![]() |
![]() |
![]() |
![]() |
PtUpDown
Vertical or horizontal increment/decrement buttons
Class hierarchy:
PtWidget --> PtBasic --> PtUpDown
For more information, see the diagram of the widget hierarchy.
PhAB icon:
Public header:
<photon/PtUpDown.h>
Description:
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.
New resources:
| Resource | C type | Pt type | Default |
|---|---|---|---|
| Pt_ARG_ARM_COLOR | PgColor_t | Scalar | PgGray(170) |
| Pt_ARG_ORIENTATION | int | Boolean | Pt_VERTICAL |
| Pt_ARG_SPACING | unsigned short | Scalar | 0 |
| Pt_ARG_UPDOWN_ARM_DATA_DECREMENT | PhImage_t * | Image | NULL |
| Pt_ARG_UPDOWN_ARM_DATA_INCREMENT | PhImage_t * | Image | NULL |
| Pt_ARG_UPDOWN_BORDER_WIDTH | unsigned short | Scalar | 1 |
| Pt_ARG_UPDOWN_DATA_DECREMENT | PhImage_t * | Image | NULL |
| Pt_ARG_UPDOWN_DATA_INCREMENT | PhImage_t * | Image | NULL |
| Pt_ARG_UPDOWN_FLAGS | signed short | Flag | See below |
| Pt_ARG_UPDOWN_INDICATOR_MARGIN | unsigned short | Scalar | 0 |
Pt_ARG_ARM_COLOR
| C type | Pt type | Default |
|---|---|---|
| PgColor_t | Scalar | Pg_GRAY |
The background color used when the button is armed (pressed in). See PgColor_t in the Photon Library Reference.
This resource is used only if Pt_ARG_UPDOWN_FLAGS has Pt_UPDOWN_FILL_ON_ARM set.
Pt_ARG_ORIENTATION
| C type | Pt type | Default |
|---|---|---|
| int | Boolean | Pt_VERTICAL |
The direction the arrows are pointing:
- Pt_VERTICAL
- Pt_HORIZONTAL
Pt_ARG_SPACING
| C type | Pt type | Default |
|---|---|---|
| unsigned short | Scalar | 0 |
The spacing between the increment and decrement buttons, in pixels.
Pt_ARG_UPDOWN_ARM_DATA_DECREMENT
| C type | Pt type | Default |
|---|---|---|
| PhImage_t * | Image | NULL |
The image for the armed decrement button. This resource is used only if Pt_UPDOWN_ARM_DECREMENT is set in Pt_ARG_UPDOWN_FLAGS.
Pt_ARG_UPDOWN_ARM_DATA_INCREMENT
| C type | Pt type | Default |
|---|---|---|
| PhImage_t * | Image | NULL |
The image for the armed increment button. This resource is used only if Pt_UPDOWN_ARM_INCREMENT is set in Pt_ARG_UPDOWN_FLAGS.
Pt_ARG_UPDOWN_BORDER_WIDTH
| C type | Pt type | Default |
|---|---|---|
| unsigned short | Scalar | 1 |
The width of the widget's border, in pixels.
Pt_ARG_UPDOWN_DATA_DECREMENT
| C type | Pt type | Default |
|---|---|---|
| PhImage_t * | Image | NULL |
The image for the unarmed decrement button. This resource is used only if Pt_UPDOWN_DECREMENT is set in Pt_ARG_UPDOWN_FLAGS.
Pt_ARG_UPDOWN_DATA_INCREMENT
| C type | Pt type | Default |
|---|---|---|
| PhImage_t * | Image | NULL |
The image for the unarmed increment button. This resource is used only if Pt_UPDOWN_INCREMENT is set in Pt_ARG_UPDOWN_FLAGS.
Pt_ARG_UPDOWN_FLAGS
| C type | Pt type | Default |
|---|---|---|
| signed short | Flag | Pt_FILL_ON_ARM |
- Pt_UPDOWN_INCREMENT_IMAGE
- Use the Pt_ARG_UPDOWN_DATA_INCREMENT resource as the image for the unarmed increment button.
- Pt_UPDOWN_DECREMENT_IMAGE
- Use the Pt_ARG_UPDOWN_DATA_DECREMENT resource as the image for the unarmed decrement button.
- Pt_UPDOWN_INCREMENT_ARM_IMAGE
- Use the Pt_ARG_UPDOWN_ARM_DATA_INCREMENT resource as the image for the armed increment button.
- Pt_UPDOWN_DECREMENT_ARM_IMAGE
- Use the Pt_ARG_UPDOWN_ARM_DATA_DECREMENT resource as the image for the armed decrement button.
- Pt_UPDOWN_ROTATE_INDICATORS
- Rotate the arrow indicators on the increment and decrement buttons by ninety degrees. This flag only applies to arrow indicators; it doesn't rotate images when images are used.
- Pt_UPDOWN_FILL_ON_ARM
- Not currently used.
Pt_ARG_UPDOWN_INDICATOR_MARGIN
| C type | Pt type | Default |
|---|---|---|
| unsigned | Scalar | 0 |
The distance, in pixels, around the button image.
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.
Pt_CB_ACTIVATE, Pt_CB_ARM, Pt_CB_DISARM, Pt_CB_REPEAT
These callbacks are passed a PtCallbackInfo_t structure that contains at least the following members:
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:
- UPDOWN_TOP
- UPDOWN_BOTTOM
- UPDOWN_LEFT
- UPDOWN_RIGHT
![]() |
![]() |
![]() |
![]() |
![[Previous]](prev.gif)
![[Contents]](contents.gif)
![[Index]](keyword_index.gif)
![[Next]](next.gif)