Reference | Status

These functions control the display of text in the status box.

PS.StatusText ( str )

Sets and/or returns the text in the status box above the grid.

Parameters:

  1. (optional) str : string

Returns: string

The optional str parameter must be a valid Javascript string. Any other value causes an error.

Any text previously visible in the status box is erased.

The specified text is centered in the status box. If the string is too wide to fit inside the box, the left and right edges of the text are clipped.

If the empty string ("") is passed, the status box is erased. If no str parameter is supplied, the status box is unchanged.

The return value is the status box text resulting from the function call.

PS.StatusColor ( color )

Sets and/or returns the color of the text in the status box.

Parameters:

  1. (optional) color, one of:
    • rgb : integer (a single multiplexed rgb value)
    • r, g, b: integer (separate r, g and b values)
    • [ r, g, b: integer ] (a single r, g, b array)
    • { r, g, b: integer } (a single r, g, b table)
    • PS.DEFAULT
    • PS.CURRENT

Returns: integer

The optional color parameter(s) specifies the color to be assigned to the status text. It can be supplied in any of four formats:

(Refer to the documentation for PS.BeadColor() for examples of how to use the different color parameter formats.)

If the constant PS.DEFAULT is specified, the default color (black) is applied.

If the constant PS.CURRENT is specified, or no color parameter is supplied, the current color is maintained.

The return value is the color of the status box text resulting from the function call.

NOTE: If you change the color of the status box text, check the background color of the grid to be sure the text is still readable.

PS.StatusFadeUp ( rate )

Controls the status line's fade-up effect.

Parameters:

  1. (optional) rate: integer

Returns: integer or PS.ERROR

By default, when the text in the status line is changed with PS.StatusText(), the text smoothly fades up from the background color to the current status text color, and remains visible until the text is replaced.

PS.StatusFadeUp() lets you turn this effect off or on, and control the rate of the fade-in.

The optional rate parameter controls the duration of the fade-in effect. If rate is not supplied, or specified as PS.CURRENT, the current fade-up rate is not changed. If rate is specified as zero (0) or any negative number, the fade-up effect is disabled.

If rate is an integer greater than zero (0), it enables the fade-up effect and specifies its duration in 60ths of a second.

If PS.DEFAULT is specified for rate, the default value (60, or one second) is applied.

The return value is an integer indicating the current rate of the fade-up effect in 60ths of a second, or zero (0) if it is disabled. PS.ERROR is returned if a parameter error occurs.

PS.StatusFadeDown ( rate, delay )

Controls the status line's fade-down effect.

Parameters:

  1. (optional) rate: integer
  2. (optional) delay: integer

Returns: object or PS.ERROR

The status line offers an optional fade-down effect, which smoothly dissolves the text from its current color to the background color. By default, this feature is disabled. PS.StatusFadeDown() lets you turn the effect on or off, control the rate of the fade-out, and specify a delay before the effect begins.

The optional rate parameter controls the duration of the fade-out effect. If rate is not supplied, or specified as PS.CURRENT, the current fade-down rate is not changed. If rate is specified as zero (0) or any negative number, the fade-down effect is disabled.

If rate is an integer greater than zero (0), it enables the fade-down effect and specifies its duration in 60ths of a second.

If PS.DEFAULT is specified for rate, the default value (0, no fade-out) is applied.

The optional delay parameter controls the delay between the end of the fade-in effect triggered by the last call to PS.StatusText() and the beginning of the subsequent fade-out.

If delay is not supplied, or specified as PS.CURRENT, the current delay rate is not changed. If delay is specified as zero (0) or any negative number, the fade-down delay is disabled.

If delay is an integer greater than zero (0), it enables the fade-down delay and specifies its duration in 60ths of a second.

If PS.DEFAULT is specified for delay, the default value (120, or two seconds) is applied.

PS.ERROR is returned if a parameter error occurs. Otherwise, the return value is a object with two named elements, rate and delay. The rate element contains an integer indicating the current rate of the fade-down effect in 60ths of a second, or zero (0) if it is disabled. The delay element contains an integer indicating the current duration of the fade-down delay in 60ths of a second.