PtNumericInteger
Integer numeric widget
Class hierarchy:
PtWidget --> PtBasic --> PtContainer --> PtCompound --> PtNumeric --> PtNumericInteger
For more information, see the diagram of the widget hierarchy.
PhAB icon:

Public header:
<photon/PtNumericInteger.h>
Description:
The PtNumericInteger class lets the user specify integer values between given minimum and maximum values.

A PtNumericInteger widget.
A PtUpDown widget is also shown to allow the user to 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 (e.g. 1,000).
If you want the value to be displayed as a hexadecimal value, set Pt_NUMERIC_HEXADECIMAL in the Pt_ARG_NUMERIC_FLAGS resource.
New resources:
| Resource | C type | Pt type | Default |
|---|---|---|---|
| Pt_ARG_NUMERIC_INCREMENT | int | Scalar | 1 |
| Pt_ARG_NUMERIC_MAX | int | Scalar | 1000000 |
| Pt_ARG_NUMERIC_MIN | int | Scalar | -1000000 |
| Pt_ARG_NUMERIC_VALUE | int | Scalar | 0 |
| Pt_CB_NUMERIC_CHANGED | PtCallback_t * | Link | NULL |
Pt_ARG_NUMERIC_INCREMENT
| C type | Pt type | Default |
|---|---|---|
| int | Scalar | 1 |
The amount by which to increase or decrease the value when the up/down buttons are pressed.
Pt_ARG_NUMERIC_MAX
| C type | Pt type | Default |
|---|---|---|
| int | Scalar | 1000000 |
The maximum value for the widget.
Pt_ARG_NUMERIC_MIN
| C type | Pt type | Default |
|---|---|---|
| int | Scalar | -1000000 |
The minimum value for the widget.
Pt_ARG_NUMERIC_VALUE
| C type | Pt type | Default |
|---|---|---|
| int | Scalar | 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:
- Pt_NUMERIC_CHANGED - the text in the numeric's text field has been changed.
- Pt_NUMERIC_UPDOWN_ACTIVATE - a button was pressed to change the current value.
- Pt_NUMERIC_UPDOWN_REPEAT - a button was held down to change the current value.
- cbdata
- A pointer to a PtNumericIntegerCallback_t structure that
contains at least:
- int numeric_value - the current value of the widget.
These callbacks should return Pt_CONTINUE.
Exported subordinate children:
Unless the resources are already defined in PtNumericInteger, the PtNumericInteger class uses the resources of its exported subordinate child, PtUpDown.
The PtNumericInteger class "inherits" all the resources of its exported subordinate child. Where PtNumericInteger and its exported subordinate child both define resources having the same name, the resource defined in PtNumericInteger 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.
- 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 PtNumericInteger's text field.
