[futurebasic] re: Re: [FB] re:Animated Cursor, with a color cursor, tedd's users are in luck

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2002 : Group Archive : Group : All Groups

From: Bowerbird@...
Date: Wed, 27 Feb 2002 13:21:06 EST
tedd said:
>   The only problem here is that 
>   Jim wanted a colored cursor. 
>   But, if I  had to add more than 10 lines of code 
>  to my program to do it, then the user would be 
>   stuck with a black/white cursor.

looks like your users are in luck;
the function is just 7 lines long,
in this fb2 example dating to 1995.

-bowerbird

RESOURCES "Cursor.rsrc"

'-------------------------- Constants ---------------
_lassoCursor       =  133
_colorBucketCur    =  128
_colorHandCur      =  129

'--------------------------- Function ---------------
LOCAL FN ShowColorCURS (id%)       'color cursor
  cursH& = FN GETCCURSOR(id%)      'look for crsr resource
  LONG IF FN RESERROR = _noErr     'no resource error?
    CALL SETCCURSOR(cursH&)        'set cursor to new one
    CALL RELEASERESOURCE (cursH&)
  END IF
END FN

'-------------------------- Main --------------------

WINDOW #1
TEXT _geneva, 12
PRINT
PRINT "Color paint bucket cursor…"
FN ShowColorCURS (_colorBucketCur)    'display "crsr" number 128
DELAY _sec * 3

PRINT
PRINT "Color hand cursor…"
FN ShowColorCURS (_colorHandCur)  'display "crsr" number 129
DELAY _sec * 3

PRINT
PRINT "Black and white cursor…"
CURSOR _lassoCursor       'display B&W cursor number 133
DELAY _sec * 3

PRINT
PRINT "Finished…"
CURSOR _arrowCursor      'reset to arrow
STOP