The cursor displayed on the screen gives contextual information to the user about a possible or current action. This is why this interface element should not be overlooked.
You might use this technique to provide visual feedback about what actions the user can take with the mouse. For example, you might display one of the resize cursors whenever the mouse moves over a portion of your view that acts as a custom resizing handle. To set this up, you'll use the command SET CURSOR that allow to change the displayed cursor.
📌 As the effect of this command can be cancelled at any time by a system request for a display update, it is recommended to use it during the On mouse move event. And conversely, if there is no request for a redraw, the cursor may not be reset.
So, the best practice is to set the cursor at the On Mouse Enter and On Mouse Move events, and to remember to restore the standard mouse cursor at the On Mouse Leave event. Like this for example:
$e:=FORM Event
If ($e.code=On Mouse Enter)\
| ($e.code=On Mouse Move)
SET CURSOR($id)
Else
SET CURSOR
End if
Note: Cursor availability and appearance may vary depending on the operating system.
The testCursors project allows you to explore the system cursors available on your platform.
The following table shows and describes the avalaible system cursors and indicates the id to pass in the cursor parameter.