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

PtUpDown

Vertical or horizontal increment/decrement buttons

Class hierarchy:

PtWidget --> PtBasic --> PtContainer --> PtUpDown

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

PhAB icon:

PtUpDown button in PhAB

Public header:

<photon/PtUpDown.h>

Description:

The PtUpDown widget creates vertical or horizontal increment/decrement buttons. It lets you increase or decrease a value.


PtUpDown


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_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

Pt_ARG_UPDOWN_ARM_DATA_BOTTOM, Pt_ARG_UPDOWN_ARM_DATA_LEFT, Pt_ARG_UPDOWN_ARM_DATA_RIGHT, Pt_ARG_UPDOWN_ARM_DATA_TOP

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.


Note: 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.


Pt_ARG_UPDOWN_BOTTOM_BORDER_COLOR

C type Pt type Default
PgColor_t Scalar Pg_DGRAY

The color of the outermost bottom and right borders.

Pt_ARG_UPDOWN_DATA_BOTTOM, Pt_ARG_UPDOWN_DATA_LEFT, Pt_ARG_UPDOWN_DATA_RIGHT, Pt_ARG_UPDOWN_DATA_TOP

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.


Note: Set the image's flags as described for Pt_ARG_UPDOWN_ARM_DATA_BOTTOM.

Pt_ARG_UPDOWN_FILL_COLOR

C type Pt type Default
PgColor_t Scalar Pg_GRAY

The background color.

Pt_ARG_UPDOWN_FLAGS

C type Pt type Default
long Scalar Pt_HIGHLIGHTED | Pt_GETS_FOCUS

These flags specify the appearance of the outermost borders:

Pt_HIGHLIGHTED
Highlight the widget with a beveled or etched rectangle. The appearance of the rectangle depends on the Pt_ARG_BORDER_WIDTH, Pt_ARG_TOP_BORDER_COLOR, and Pt_ARG_BOT_BORDER_COLOR resources.
Pt_ETCH_HIGHLIGHT
Highlight the widget with an etched-line style (normally, a beveled rectangle is used).
Pt_CLIP_HIGHLIGHT
Clip the corners of the rectangle that highlights the widget.
Pt_BLOCKED
Prevent the widget and all its non-window-class children from interacting with Photon events.
Pt_MENUABLE
Make the widget respond to right-mouse-button clicks (i.e. enable PtBasic's Pt_CB_MENU callback.
Pt_GETS_FOCUS
Allow the widget to be granted focus when appropriate.

Note: Use the Pt_ARG_FLAGS resource to change the appearance of the inner borders. Only the following flags are supported for this widget:
  • Pt_HIGHLIGHTED
  • Pt_ETCH_HIGHLIGHT
  • Pt_CLIP_HIGHLIGHT

Pt_ARG_UPDOWN_HIGHLIGHT_ROUND

C type Pt type Default
unsigned short Scalar 0

The roundness of the outermost borders.

Pt_ARG_UPDOWN_MARGIN_HEIGHT

C type Pt type Default
unsigned short Scalar 0

The amount of vertical space between the outermost border and the inner images.

Pt_ARG_UPDOWN_MARGIN_WIDTH

C type Pt type Default
unsigned short Scalar 0

The amount of horizontal space between the outermost border and the inner images.

Pt_ARG_UPDOWN_ORIENTATION

C type Pt type Default
int Scalar Pt_VERTICAL

The direction the arrows are pointing:

Pt_ARG_UPDOWN_SPACING

C type Pt type Default
unsigned Scalar 0

The distance, in pixels, between the buttons.

Pt_ARG_UPDOWN_TOP_BORDER_COLOR

C type Pt type Default
PgColor_t Scalar Pg_WHITE

The color of the outermost top and left borders.

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 PtContainer Not used by this class.
Pt_ARG_ANCHOR_OFFSETS PtContainer Not used by this class.
Pt_ARG_AREA PtWidget
Pt_ARG_BANDWIDTH_THRESHOLD PtBasic Not used by this class.
Pt_ARG_ARM_COLOR PtButton
Pt_ARG_ARM_FILL PtButton
Pt_ARG_BITMAP_CURSOR PtWidget
Pt_ARG_BORDER_WIDTH PtWidget
Pt_ARG_BOT_BORDER_COLOR PtBasic
Pt_ARG_COLOR PtBasic Not used by this class.
Pt_ARG_CONTAINER_FLAGS PtContainer Not used by this class.
Pt_ARG_CURSOR_COLOR PtWidget
Pt_ARG_CURSOR_TYPE PtWidget
Pt_ARG_DATA PtWidget
Pt_ARG_DIM PtWidget
Pt_ARG_EFLAGS PtWidget Pt_CONSUME_EVENTS
Pt_ARG_FILL_COLOR PtBasic Not used by this class.
Pt_ARG_FILL_PATTERN PtBasic Not used by this class.
Pt_ARG_FLAGS PtWidget See below.
Pt_ARG_HELP_TOPIC PtWidget
Pt_ARG_HIGHLIGHT_ROUNDNESS PtBasic
Pt_ARG_MARGIN_HEIGHT PtBasic Not used by this class.
Pt_ARG_MARGIN_WIDTH PtBasic Not used by this class.
Pt_ARG_POS PtWidget
Pt_ARG_RESIZE_FLAGS PtWidget
Pt_ARG_TOP_BORDER_COLOR PtBasic
Pt_ARG_TRANS_PATTERN PtBasic
Pt_ARG_USER_DATA PtWidget
Pt_CB_ACTIVATE PtBasic See below.
Pt_CB_ARM PtBasic See below.
Pt_CB_BALLOONS PtContainer Not used by this class.
Pt_CB_BLOCKED PtWidget
Pt_CB_DESTROYED PtWidget
Pt_CB_DISARM PtBasic See below.
Pt_CB_FILTER PtContainer Not used by this class.
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_RESIZE PtContainer Not used by this class.
Pt_CB_UNREALIZED PtWidget
Pt_ARG_FLAGS
Only the following flags are supported for this 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:


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