Knowledge Base

# 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:

btnThe button number to use. The button must have been initially displayed and explicitly numbered with a ButtonEvent.
RowThe 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.
ColThe 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.
HeightThe height of the button in multiples of the character height of the default font.
WidthThe width of the button in multiples of the character width of the default font.
VisibleIf 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
ClickCodeThe 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 specifierAs a column specifier
5Row number 5 from the top, counting from 0. This can be a fractional number such as 5.5Column number 5 from the left, counting from 0
-5Row 5 from the bottom, counting from 0. This can be a fractional number such as -5.25Column 5 from the right, counting from 0
0The top character rowThe left-most character column
-0The bottom character rowThe right-most character column
0.25One 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.25One quarter of the screen height from the bottom.One quarter of the screen width from the right.
CThe top-bottom centre of the screen.The left-right centre of the screen.
C+5Five character rows down from the centreFive character widths right from the centre.
C-5Five character rows up from the centreFive character width left from the centre.
C+.25One 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.25Three 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 specifierAs a width specifier
55 character rows in height5 character rows in width
0.25One 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.