Floating-point numeric widget
PtWidget --> PtBasic --> PtContainer --> PtCompound --> PtNumeric --> PtNumericFloat
For more information, see the diagram of the widget hierarchy.
<photon/PtNumericFloat.h>
The PtNumericFloat class is a numeric widget that allows you to enter floating-point values between given minimum and maximum values.
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).
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 |
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.
C type | Pt type | Default |
---|---|---|
double * | Struct | 1000000.00 |
The maximum value for the widget.
C type | Pt type | Default |
---|---|---|
double * | Struct | -1000000.00 |
The minimum value for the widget.
C type | Pt type | Default |
---|---|---|
int | Scalar | 2 |
The precision or number of displayed decimal places of the widget's current value.
C type | Pt type | Default |
---|---|---|
double * | Struct | 0.0 |
The current value of the widget.
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:
These callbacks should return Pt_CONTINUE.
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.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.