[futurebasic] re:Animated Cursor

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

From: SVANVOORST@...
Date: Tue, 26 Feb 2002 22:56:03 EST
The following code will display an animated watch cursor while 3,600 edit 
fields are loaded.  The cursorID is changed each second while the function 
runs.  "Cursor.rsrc" is located in the Examples/Cursor folder.

'--------- Start FB^3 Code -------------
RESOURCES "Cursor.rsrc

local
dim j,k
dim left%
dim top%
dim tmp$
dim id%
dim type%
dim just%
DIM cursID as int
dim lastTick&
dim currTick&
LOCAL FN buildGrid(l%,t%,w%,h%,col%,row%,vg%,hg%)'Any size,location
id% = 1
cursID = 1001
type% = _statFramed
just% = _centerJust
lastTick& = timer
FOR k = 0 TO row%-1 'Build by row
FOR j = 0 TO col%-1
left% = l%+j*(w%+vg%)
top%  = t%+k*(h%+hg%)
tmp$=STR$(id%)
EDIT FIELD#id%,tmp$,(left%,top%)-(left%+w%,top%+h%),type%,just%
INC(id%)
cursor cursID
currTick& = timer
long if (currTick&) - (lastTick&) => 1
inc(cursID)
lastTick& = currTick&
end if
if cursID > 1007 then cursID = 1001
NEXT j
next k
edit field(0)
END Fn

local
local fn buildWnd
WINDOW #1,"Animated Cursor.demo",(30,40)-(600,700),_docNoGrow
Print:PRINT "  **  Application is loading 3600 edit fields.  **"
FN buildGrid(40,30,40,20,12,300,0,0)
cls
end fn

local
dim evnt%
dim id%
LOCAL FN doDialog
evnt%=DIALOG(0)
id%=DIALOG(evnt)
SELECT evnt%
CASE _wndClose
END
END SELECT
END FN

fn buildWnd
on dialog fn doDialog
DO
HANDLEEVENTS
UNTIL 0

'------------ End FB^3 Code ----------

Steve Van Voorst