PtNumeric

PtNumeric — A parent class for numeric widget resources.

Synopsis

class PtNumeric PtContainer
{
    numeric_flags;                    // flag  (Pt_ARG_NUMERIC_FLAGS)    
    numeric_prefix;                   // string  (Pt_ARG_NUMERIC_PREFIX)    
    numeric_suffix;                   // string  (Pt_ARG_NUMERIC_SUFFIX)    
    numeric_text_border;              // integer  (Pt_ARG_NUMERIC_TEXT_BORDER)    
    numeric_text_bot_border_color;    // color  (Pt_ARG_NUMERIC_TEXT_BOT_BORDER_COLOR)    
    numeric_text_color;               // color  (Pt_ARG_NUMERIC_TEXT_COLOR)    
    numeric_text_fill_color;          // color  (Pt_ARG_NUMERIC_TEXT_FILL_COLOR)    
    numeric_text_font;                // string  (Pt_ARG_NUMERIC_TEXT_FONT)    
    numeric_text_top_border_color;    // color  (Pt_ARG_NUMERIC_TEXT_TOP_BORDER_COLOR)    
    numeric_updown_border_width;      // integer  (Pt_ARG_NUMERIC_UPDOWN_BORDER_WIDTH)    
    numeric_updown_width;             // integer  (Pt_ARG_NUMERIC_UPDOWN_WIDTH)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtContainer <-- PtNumeric

Derived Classes

PtNumericFloat, PtNumericInteger

Description

This class serves as a parent class of resources for numeric widgets, and is not normally instantiated. It joins a PtText widget with a PtUpDown widget, creating a text-entry box for numbers that can be incremented or decremented with small arrow-shaped buttons.

[Note]

For detailed information, please refer to PtNumeric in the Photon documentation.

Instance Variables

numeric_flags

This instance variable controls the behavior and display of the widget, and may be a combination of zero or more of the following flags:

ConstantDescription
Pt_NUMERIC_ENABLE_UPDOWNDisplays the Up and Down arrow buttons. Default is ON.
Pt_NUMERIC_USE_SEPARATORSUse comma separators for numbers over 999 (e.g. 5,324,890).
Pt_NUMERIC_WRAPWrap numbers from minimum to maximum and from maximum to minimum. Default is ON.
Pt_NUMERIC_AUTO_HIGHLIGHTHighlight text when selected. Default is ON.

numeric_prefix

A string that is prefixed to all numbers entered.

numeric_suffix

A string that is appended to all numbers entered.

numeric_text_border

A number of pixels specifying the border width of the text display window.

numeric_text_bot_border_color

A string specifying a color for the bottom border. Default is 0x606060 (dark grey).

numeric_text_color

A string specifying a color for numeric text. Default is 0x0 (black).

numeric_text_fill_color

A string specifying a color for the text display. Default is 0xc0c0c0 (grey).

numeric_text_font

A string specifying the text font. Default is "helv12".

numeric_text_top_border_color

A string specifying a color for the top border. Default is 0xffffff (white).

numeric_updown_border_width

A number of pixels specifying the border width of the PtUpDown arrow buttons.

numeric_updown_width

A number of pixels specifying the width of the PtUpDown arrow buttons.

Callbacks

The following callback is associated with this widget:

CallbackDescription
Pt_CB_NUMERIC_CHANGEDThis callback is generated when the entered value changes.

Associated Classes

PtNumericFloatCallback, PtNumericIntegerCallback, PtCallbackInfo

Example

See the example for PtNumericInteger.