PtToggleButton

PtToggleButton — A button that toggles ON or OFF.

Synopsis

class PtToggleButton PtLabel
{
    indicator_color;     // color  (Pt_ARG_INDICATOR_COLOR)    
    indicator_depth;     // unsigned short  (Pt_ARG_INDICATOR_DEPTH)    
    indicator_height;    // unsigned short  (Pt_ARG_INDICATOR_HEIGHT)    
    indicator_type;      // unsigned char  (Pt_ARG_INDICATOR_TYPE)    
    indicator_width;     // unsigned short  (Pt_ARG_INDICATOR_WIDTH)    
    set_color;           // color  (Pt_ARG_SET_COLOR)    
    set_fill;            // unsigned char  (Pt_ARG_SET_FILL)    
    spacing;             // unsigned short  (Pt_ARG_SPACING)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtLabel <-- PtToggleButton

Derived Classes

PtOnOffButton

Description

This widget is a button that toggles ON and OFF, made up of an on/off indicator and a text label. Its instance variables control the size, shape, and color of the on/off indicator, as well as the font size of the corresponding label text.

[Note]

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

Instance Variables

indicator_color

A number specifying the color of the on/off indicator when the button is OFF. Default is 0xc0c0c0 (grey).

indicator_depth

A number of pixels specifying the border width of the on/off indicator (giving the appearance of depth when the button is ON). Default is 2.

indicator_height

A number of pixels specifying the height of the on/off indicator. Default is adjusted according to the font size of the label text.

indicator_type

This instance variable controls the shape of the indicator, and may have one of the following values:

ConstantDescription
Pt_N_OF_MANYGives the on/off indicator a diamond shape.
Pt_ONE_OF_MANYGives the on/off indicator a square shape.
Pt_RADIOMakes the on/off indicator a round, radio-button style.
Pt_ROUNDGives the on/off indicator a round shape.

indicator_width

A number of pixels specifying the width of the on/off indicator. Default is adjusted according to the font size of the label text.

set_color

A number indicating the color of the indicator when the button is ON (pressed in). Default is 0xaaaaaa (dark grey).

set_fill

A control bit for set_color. The default, 1, means that the color specified in set_color will be used for the on/off indicator when the button is ON. If 0 is specified here, the on/off indicator will not change color when the button is ON.

spacing

A number of pixels specifying the space between the on/off indicator and the label text. Default is 4.