GUI CURSOR

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
GUI CURSOR ON [cursorno [, x, y [, cursorcolour]]]
GUI CURSOR x, y
GUI CURSOR COLOUR cursorcolour
GUI CURSOR OFF
GUI CURSOR HIDE
GUI CURSOR SHOW
GUI CURSOR LOAD

Description:
The GUI CURSOR command provides a mechanism for displaying and manipulating a cursor on the screen. 
The cursor sits above all other graphics and nothing can overwrite it. BLIT, page copy, text, sprite, box etc. can all be used and the cursor will stay in view unless deliberately hidden. 
The cursor is always on PAGE 0 for colours 8 and 16 and page 1 for 12-bit colour and it can be moved even if the write page is somewhere else.

GUI CURSOR ON [cursorno [, x, y [, cursorcolour]]]
Cursor no can be 0 (Default: mouse type pointer) or 1 (cross), in addition the user can load his own cursor using a SPRITE look-alike file in which case this is cursor no. 2 
For cursor numbers 0 and 1 the programmer can override the default white cursor by specifying the colour in the open command.

GUI CURSOR x, y 
moves the cursor to x, y 
If the cursor is hidden - it just remembers the new location but does not show the cursor.

GUI CURSOR COLOUR cursorcolour
Changes the colour of cursor number 0 or 1. Does not impact loaded cursors where its colours are specified by the cursor designer

GUI CURSOR OFF 
Turns off the cursor and allows you to select a different one (see test prog)

GUI CURSOR HIDE
Hides the cursor but maintains its position

GUI CURSOR SHOW 
Shows a hidden cursor in its original position

GUI CURSOR LOAD "fname"
This loads a user cursor using the Maximite sprite mechanism with a minor change. 
The header is now Width, height, xoffset, yoffset. 
The two offsets determine where on the cursor the pointer is defined to be. So the mouse cursor has offsets 0,0 and the cross has offsets 7,7

 

 

 'mouse and cursor test
 CLS
 MODE 1
 GUI cursor ON
 CONTROLLER MOUSE OPEN 2, leftclick, rightclick
 
 SETTICK 20, myint
DO:LOOP UNTIL INKEY$ <> "" '
 CONTROLLER MOUSE CLOSE 2
END
 
SUB myint
  GUI cursor MOUSE(x,2),MOUSE(y,2)
END SUB
 '
SUB leftclick
  STATIC INTEGER n
  LOCAL INTEGER x=MOUSE(x,2),y=MOUSE(y,2)
  GUI cursor OFF
  GUI cursor ON 1,x,y, RGB(RED)
  n=n+1
  PRINT @(100,100)"left",n
END SUB
 '
SUB rightclick
  STATIC INTEGER n=0
  LOCAL INTEGER x=MOUSE(x,2),y=MOUSE(y,2)
  GUI cursor OFF
  GUI cursor ON 0,x,y
  n=n+1
  PRINT @(200,100)"Right",n
END SUB

Last edited: 25 February, 2021