Remember the NSProgressIndicator OS X?
Wouter
wouter.abraham at pi.be
Sat Jul 17 08:22:52 EDT 2004
> Re: Remember the NSProgressIndicator OS X?
> • From: Klaus Major
> • Subject: Re: Remember the NSProgressIndicator OS X?
> • Date: Fri, 16 Jul 2004 13:52:56 -0700
>
> Hi Wouter,
>
>
> actually it was me who posted this question long ago ;-)
>
snip
>
> Wow, dat is heelemal COOL, hartelijk bedankt!!!!!
>
>
> :-)
>
>
> Greetings,
> WA
>
>
> Regards and groetjes
>
>
> Klaus Major
Tnx to all responders.
A small update with a slightly different approach.
Better simulation, but still no antialiased graphics :-(
Less overhead, only 6 moving lines.
And well within the scriptlimits of "doing" things ( in the runLines
handler :-)
constant cStar = "grc runningStarX"
local aPoints,runState,Cp
on mouseUp
if runstate = 0 then set the label of me to "Stop Running"
else set the label of me to "Start Running"
if runstate <> 0 then
stopLines
exit to top
end if
put the right of me + 20,item 2 of the loc of me into CP
put 9 into runState
delete var aPoints
prepArray 13,7
startLines
runLines
end mouseUp
on runLines
if runState <> 0 then
do aPoints[runstate]
if runstate = 12 then put 1 into runstate
else add 1 to runState
send "runLines" to me in 70 millisecs
end if
end runLines
on stopLines
repeat with i = 7 down to 1
put cStar & i into tStar
hide tSTar
wait 50 millisecs
end repeat
put 0 into runState
delete grp "runningStarX"
end stopLines
on startLines
repeat 2
put cStar & 7 into tZeroStar
do aPoints[0]
put 244 into tC
set the colors of tZeroStar to tC,tC,tC
show tZeroStar
repeat with i = 1 to 6
put cStar & i into tStar
do aPoints[runstate]
subtract 2 from tC
set the colors of tZeroStar to tC,tC,tC
if runstate = 12 then put 1 into runstate
else add 1 to runState
if not the visible of tStar then show tStar
wait 70 millisecs
end repeat
end repeat
end startLines
on prepArray tG,tK
if there is no grp "runningStarX" then goCreateSome
put item 1 of Cp into tX
put item 2 of Cp into tY
put (2 * pi / 12) into sRad
repeat with i = 1 to 12
put trunc(tG * cos (sRad * i)) + tX into a
put trunc(tG * sin (sRad * i)) + tY into b
put trunc(tK * cos (sRad * i)) + tX into c
put trunc(tK * sin (sRad * i)) + tY into d
put quote & a,b & quote && "& cr &" & quote& c,d & quote into
aTemp[i]
end repeat
repeat with j = 1 to 12
repeat with i = 1 to 6
put cStar & i into tStar
put j - i + 1 into x
if x <= 0 then add 12 to x
put "set the points of" && the name of tStar && "to" && aTemp[x]
after aPoints[j]
end repeat
if j <> 1 then put "& cr & cr &" & aTemp[j] after aTemp[0]
else put aTemp[j] after aTemp[0]
end repeat
put cStar& "7" into tStar
put "set the points of" && the name of tStar && "to" && aTemp[0] &
cr into aPoints[0]
end prepArray
on goCreateSome
put 220 into tC
repeat with i = 7 down to 1
put tC,tC,tC into tColors[i]
subtract 20 from tC
end repeat
repeat with i = 7 down to 1
put cStar&i into tStar
do "create invisible" && tStar
set the style of tStar to polygon
set the linesize of tStar to 2
set the colors of tStar to tColors[i]
put the name of tStar && "and " after tList
end repeat
delete last word of tList
do "group" && tList
set the name of last grp to "runningStarX"
choose browse tool
end goCreateSome
Greetings,
WA
More information about the use-livecode
mailing list