# 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:
|
The button number to use. The button must have been initially displayed and explicitly numbered with a |
|
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. |
|
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. |
|
The height of the button in multiples of the character height of the default font. |
|
The width of the button in multiples of the character width of the default font. |
|
If this is 0, the button will be invisible. Any non-zero value makes the button visible. |
|
The text to be displayed on the button. This must be enclosed in quotation marks. Non-printing characters are not possible |
|
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 |
---|---|---|
|
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 |
|
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 |
|
The top character row | The left-most character column |
|
The bottom character row | The right-most character column |
|
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. |
|
One quarter of the screen height from the bottom. | One quarter of the screen width from the right. |
|
The top-bottom centre of the screen. | The left-right centre of the screen. |
|
Five character rows down from the centre | Five character widths right from the centre. |
|
Five character rows up from the centre | Five character width left from the centre. |
|
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. |
|
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 character rows in height | 5 character rows in width |
|
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 ButtonEven
t for a higher level of functionality.