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

PtNumericFloat

Floating-point numeric widget

Class hierarchy:

PtWidget --> PtBasic --> PtContainer --> PtCompound --> PtNumeric --> PtNumericFloat

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

PhAB icon:

PtNumericFloat button in PhAB

Public header:

<photon/PtNumericFloat.h>

Description:

The PtNumericFloat class is a numeric widget that allows you to enter floating-point values between given minimum and maximum values.


PtNumericFloat example


A PtNumericFloat widget.


A PtUpDown widget is also shown to let you increase or decrease the value by a set amount. The widget allows a prefix and a suffix string to be optionally added along with the ability to use comma separators and set the precision of the number (i.e. the number of decimal places, for example, 1,000.00).

New resources:

Resource C type Pt type Default
Pt_ARG_NUMERIC_INCREMENT double * Struct 1.0
Pt_ARG_NUMERIC_MAX double * Struct 1000000.00
Pt_ARG_NUMERIC_MIN double * Struct -1000000.00
Pt_ARG_NUMERIC_PRECISION int Scalar 2
Pt_ARG_NUMERIC_VALUE double * Struct 0.0
Pt_CB_NUMERIC_CHANGED PtCallback_t * Link NULL

Pt_ARG_NUMERIC_INCREMENT

C type Pt type Default
double * Struct 1.0

The value by which to increase or decrease the value when the up/down buttons are pressed.

Pt_ARG_NUMERIC_MAX

C type Pt type Default
double * Struct 1000000.00

The maximum value for the widget.

Pt_ARG_NUMERIC_MIN

C type Pt type Default
double * Struct -1000000.00

The minimum value for the widget.

Pt_ARG_NUMERIC_PRECISION

C type Pt type Default
int Scalar 2

The precision or number of displayed decimal places of the widget's current value.

Pt_ARG_NUMERIC_VALUE

C type Pt type Default
double * Struct 0.0

The current value of the widget.

Pt_CB_NUMERIC_CHANGED

C type Pt type Default
PtCallback_t * Link NULL

A list of callbacks invoked when the widget's value changes. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
The name of the callback resource (Pt_CB_NUMERIC_CHANGED) that caused this callback to be invoked.
reason_subtype
A subtype that indicates why the callback was invoked:
cbdata
A pointer to a PtNumericFloatCallback_t structure that contains at least:

These callbacks should return Pt_CONTINUE.

Exported subordinate children:

Unless the resources are already defined in PtNumericFloat, the PtNumericFloat class uses the resources of its exported subordinate child, PtUpDown.

The PtNumericFloat class "inherits" all the resources of its exported subordinate child. Where PtNumericFloat and its exported subordinate child both define resources having the same name, the resource defined in PtNumericFloat takes precedence.

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_ARM_COLOR PtButton
Pt_ARG_ARM_DATA PtButton
Pt_ARG_ARM_FILL PtButton Pg_GRAY
Pt_ARG_BANDWIDTH_THRESHOLD PtBasic Not used by this class.
Pt_ARG_BITMAP_CURSOR PtWidget
Pt_ARG_BORDER_WIDTH PtWidget 0
Pt_ARG_BOT_BORDER_COLOR PtBasic
Pt_ARG_COLOR PtBasic
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 Pg_TRANSPARENT
Pt_ARG_FILL_PATTERN PtBasic
Pt_ARG_FLAGS PtWidget 0
Pt_ARG_HELP_TOPIC PtWidget
Pt_ARG_HIGHLIGHT_ROUNDNESS PtBasic
Pt_ARG_MARGIN_HEIGHT PtBasic 0
Pt_ARG_MARGIN_WIDTH PtBasic 0
Pt_ARG_NUMERIC_FLAGS PtNumeric
Pt_ARG_NUMERIC_PREFIX PtNumeric
Pt_ARG_NUMERIC_SPACING PtNumeric
Pt_ARG_NUMERIC_SUFFIX PtNumeric
Pt_ARG_NUMERIC_TEXT_BORDER PtNumeric
Pt_ARG_NUMERIC_TEXT_BOT_BORDER_COLOR PtNumeric
Pt_ARG_NUMERIC_TEXT_COLOR PtNumeric
Pt_ARG_NUMERIC_TEXT_FILL_COLOR PtNumeric
Pt_ARG_NUMERIC_TEXT_FONT PtNumeric
Pt_ARG_NUMERIC_TEXT_TOP_BORDER_COLOR PtNumeric
Pt_ARG_NUMERIC_UPDOWN_BORDER_WIDTH PtNumeric
Pt_ARG_NUMERIC_UPDOWN_WIDTH PtNumeric
Pt_ARG_POS PtWidget
Pt_ARG_RESIZE_FLAGS PtWidget Pt_RESIZE_XY_AS_REQUIRED
Pt_ARG_TOP_BORDER_COLOR PtBasic
Pt_ARG_TRANS_PATTERN PtBasic
Pt_ARG_UPDOWN_ARM_DATA_BOTTOM PtUpDown
Pt_ARG_UPDOWN_ARM_DATA_LEFT PtUpDown
Pt_ARG_UPDOWN_ARM_DATA_RIGHT PtUpDown
Pt_ARG_UPDOWN_ARM_DATA_TOP PtUpDown
Pt_ARG_UPDOWN_BOTTOM_BORDER_COLOR PtUpDown
Pt_ARG_UPDOWN_DATA_BOTTOM PtUpDown
Pt_ARG_UPDOWN_DATA_LEFT PtUpDown
Pt_ARG_UPDOWN_DATA_RIGHT PtUpDown
Pt_ARG_UPDOWN_DATA_TOP PtUpDown
Pt_ARG_UPDOWN_FILL_COLOR PtUpDown
Pt_ARG_UPDOWN_FLAGS PtUpDown
Pt_ARG_UPDOWN_HIGHLIGHT_ROUND PtUpDown
Pt_ARG_UPDOWN_MARGIN_HEIGHT PtUpDown
Pt_ARG_UPDOWN_MARGIN_WIDTH PtUpDown
Pt_ARG_UPDOWN_ORIENTATION PtUpDown
Pt_ARG_UPDOWN_SPACING PtUpDown
Pt_ARG_UPDOWN_TOP_BORDER_COLOR PtUpDown
Pt_ARG_USER_DATA PtWidget
Pt_CB_ACTIVATE PtBasic See below.
Pt_CB_ARM PtBasic
Pt_CB_BALLOONS PtContainer Not used by this class.
Pt_CB_BLOCKED PtWidget
Pt_CB_DESTROYED PtWidget
Pt_CB_DISARM PtBasic
Pt_CB_FILTER PtContainer
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
Pt_CB_UNREALIZED PtWidget
Pt_CB_ACTIVATE
If cbinfo->reason_subtype is Pt_NUMERIC_ACTIVATE, the callback was invoked because the user changed the value and pressed Enter while in PtNumericFloat's text field.

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