[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: tedd <tedd@...>
Date: Wed, 27 Feb 2002 18:17:34 -0500
>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

-snip-

bb:

Slick. Now, try the one below. As long as you don't have any conflict 
resID's in color vs. black/white, it works fine.

Plus, if I could place my cursors in sequence, I could use a small 
LONG IF to change cursors instead of using a CASE statement.

tedd

---
dim gLastTickCount&
dim gCurrentCursor
end globals


RESOURCES "Cursor.rsrc"

'--------------------------- Function ---------------
LOCAL FN rotateCursor'color cursor
dim tickCount&

tickCount& = fn tickcount

long if tickCount& - gLastTickCount& > 10

select gCurrentCursor
case 128
gCurrentCursor = 129
case 129
gCurrentCursor = 1001
case 1001
gCurrentCursor = 1002
case 1002
gCurrentCursor = 1003
case 1003
gCurrentCursor = 1004
case 1004
gCurrentCursor = 1005
case 1005
gCurrentCursor = 1006
case 1006
gCurrentCursor = 1007
case 1007
gCurrentCursor = 128
end select

cursor (gCurrentCursor)
gLastTickCount& = tickCount&

end if

END FN

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

WINDOW #1
TEXT _geneva, 12
print "Click mouse to end"
gLastTickCount& = fn tickcount
gCurrentCursor = 128

do
FN rotateCursor
until mouse(_down)
-- 
http://sperling.com