SimpleHMI: Screen relative cursor positioning
The cursor in SimpleHMI is an imaginary point on the screen that is used as the anchor for text. The datum point is the top lefthand corner of the screen. The cursor can be positioned in several ways:
- To an absolute text row and column number.
- A given number of character sizes from the righthand edge and/or bottom edge.
- At a decimal fraction of the screen width or height, for example 0.25 for one quarter of the screen extent.
- A certain number of character widths or heights from either centre line of the screen.
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. |