SPLat Logo

# ButtonParams(btn, row, col, height, width, "text", visible, ClickHandler) hash function

NOTICE: We are updating our website. For product enquiries and orders please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

# ButtonParams(btn, row, col, height, width, "text", visible, ClickHandler) hash function

DEPRECATED

Valid for use with hash command: HMI

Don't use this without good reason. Use ButtonEvent in preference.

Change the settings of a button. All the parameters except btn are optional. To omit a parameter have the comma but nothing else.

This function is useful for dynamically changing a button's appearance without having to specify a different click handler. It makes sense only if a button is already displayed via a ButtonEvent function.

The parameters are:

btn

The button number to use. The button must have been initially displayed and explicitly numbered with a ButtonEvent.

Row

The screen row where the top of the button is to be positioned. This refers to character rows in the default font size. Row numbers are 0 based, so the top row is row 0.

Col

The screen column where the left of the button is to be positioned. This refers to character columns in the default font size. Column numbers are 0 based, so the start of each line is 0.

Height

The height of the button in multiples of the character height of the default font.

Width

The width of the button in multiples of the character width of the default font.

Visible

If this is 0, the button will be invisible. Any non-zero value makes the button visible.

"text"

The text to be displayed on the button. This must be enclosed in quotation marks. Non-printing characters are not possible

ClickCode

The actual code that will be sent by the HMI when the button is clicked. It is highly advisable not to change this!

In addition to being simple numbers, the row/column coordinates may also be specified in relative or proportional terms. The following table illustrates the possibilities.

Format (example) As a row specifier As a column specifier

5

Row number 5 from the top, counting from 0. This can be a fractional number such as 5.5 Column number 5 from the left, counting from 0

-5

Row 5 from the bottom, counting from 0. This can be a fractional number such as -5.25 Column 5 from the right, counting from 0

0

The top character row The left-most character column

-0

The bottom character row The right-most character column

0.25

One quarter of (0.25 times) the screen height from the top. Fractional number between -1 and +1 are interpreted as a fraction of the screen. One quarter of the screen width from the left.

-0.25

One quarter of the screen height from the bottom. One quarter of the screen width from the right.

C

The top-bottom centre of the screen. The left-right centre of the screen.

C+5

Five character rows down from the centre Five character widths right from the centre.

C-5

Five character rows up from the centre Five character width left from the centre.

C+.25

One quarter character row down from the centre. After a "C" all numbers are interpreted as multiples of the character pitch. One quarter character width right from the centre.

C-3.25

Three and a quarter character rows up from the centre. After a "C" all numbers are interpreted as multiples of the character pitch. Three and a quarter character widths left from the centre.

In addition to being simple numbers, the width and height coordinates may also be specified in relative or proportional terms. The following table illustrates the possibilities.

Format (example) As a height specifier As a width specifier

5

5 character rows in height 5 character rows in width

0.25

One quarter of (0.25 times) the screen height. Always calculated as a full number of rows, always rounded down, but forced to be at least 1. One quarter of (0.25 times) the screen width. Always calculated as a full number of columns, always rounded down, but forced to be at least 1.

See also ButtonEvent for a higher level of functionality.