Skip to content

Latest commit

 

History

History
87 lines (69 loc) · 4.4 KB

Don't forget the cursor.md

File metadata and controls

87 lines (69 loc) · 4.4 KB

Don't forget the cursor

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.

Demo

The testCursors project allows you to explore the system cursors available on your platform.

The cursors

The following table shows and describes the avalaible system cursors and indicates the id to pass in the cursor parameter.

macOS 4D ID Name
Alt Image Text The pointing-hand cursor 9000 pointingHandCursor
Alt Image Text The open-hand cursor 9013 openHandCursor
Alt Image Text The closed-hand cursor 9014 closedHandCursor
Alt Image Text The contextual menu cursor 9015 contextualMenuCursor
Alt Image Text The drag copy cursor 9016 dragCopyCursor
Alt Image Text The not allowed cursor 9019 notAllowedCursor
Alt Image Text The I-beam cursor for indicating insertion points 1 IBeamCursor
Alt Image Text The arrow cursor 355 pointerCursor
Alt Image Text The arrow oriented to right cursor 355 pointerToRightCursor
Alt Image Text The cross-hair cursor 2 crosshairCursor
Alt Image Text The drag link cursor 9017 dragLinkCursor
Alt Image Text The help cursor 9018 helpCursor
Alt Image Text The zoom out cursor 559 zoomOutCursor
Alt Image Text The zoom in cursor 560 zoomInCursor
Alt Image Text The move cursor 9001 moveCursor
Alt Image Text The horizontal resize cursor 9003 horizontalResizeCursor
Alt Image Text The vertical resize cursor 9004 verticalResizeCursor
Alt Image Text The resize top-left-bottom-right cursor 9005 resizeNorthWestSouthEastCursor
Alt Image Text The resize bottom-left-top-right cursor 9006 resizeNorthEastSouthWestCursor
Alt Image Text The resize-left-and-right cursor 9021 resizeleftrightCursor
Alt Image Text The resize-up-and-down cursor 9009 resizeUpDownCursor
Alt Image Text The vertical split cursor 9010 verticalSplitCursor
Alt Image Text The horizontal split cursor 9011 horizontalSplitCursor