home *** CD-ROM | disk | FTP | other *** search
- /* FREEWARE - Torsten Dudai, 2001 */
-
- Anzahl=0
- transparenz=0
- disp="none"
- savefile=""
- transval=0
- loopval=0
- kopieval=1
-
- call open(ca,'awnpipe:test/xc')
- call topipe('st "WhirlGUI for AMIGA plus 03/2001 (by T.D., Bug-Reports to torsten@dudai.de)" title "WhirlGUI V 0.1" defg v m')
-
- call topipe('layout si so b 0 weih 0')
- newgad=topipe('button ab 0 weiw 0 weih 0 minw 20 minh 20')
- gifgad=topipe('button gt "Anim" dis 1 minw 80 minh 20')
- cleargad=topipe('button gt "Liste löschen" dis 1 minw 80 minh 20')
- delgad=topipe('button gt "Entfernen" dis 1 minw 80 minh 20')
- call topipe('le')
-
- call topipe('layout si so b 0 weih 0')
- checkers=topipe('checkbox weiw 0 dis 1')
- call topipe('label gt "Transp."')
- transgad=topipe('integer maxc 3 minn 0 maxn 255 minw 50 a weiw 0 defn 0 dis 1')
- call topipe('label gt "Ersetzen" weiw 0')
- dispgad=topipe('chooser gt "Methode" pu cl "Keine|Nichts|Hintergrund|Vorheriges" minw 110 weih 0 dis 1')
- call topipe('le')
-
- call topipe('layout si so b 0 weih 0')
- call topipe('label gt "Wiederholen (0=unendlich)"')
- loopgad=topipe('integer maxc 3 minn 0 maxn 999 minw 50 a weiw 0 defn 0 dis 1')
- call topipe('label gt "Kopie"')
- kopie=topipe('checkbox s 1 weiw 0')
- call topipe('le')
-
- call topipe('layout si so h b 0 cj weih 0')
- call topipe('label gt "Ziel-Anim"')
- savegad=topipe('getfile gt "Wohin speichern?" i save dis 1')
- call topipe('le')
-
-
- call topipe('layout gt "Frames" si so v cj')
- browser=topipe('listbrowser lbl "Pfad|Zeit" st minw 200 minh 100 dis 1')
- call topipe('le')
- filegad=topipe('getfile asl gt "GIF auswählen"')
- call topipe('open')
-
-
- /* main loop*/
-
- do while ~eof(ca)
- call topipe('con')
- in= readln(ca)
- parse var in in1 in2 in3 in4 in5 .
- if in1='gadget' then call gadget()
- if in1='close' then do
- if kopieval=1 then cleanUpTemp()
- exit
- end
- end
- exit
-
-
-
- gadget:
- if in2=checkers then do
- if in3=1 then do
- call topipe('id 'transgad' dis 0 ref')
- transparenz=1
- end
- else do
- call topipe('id 'transgad' dis 1 ref')
- transparenz=0
- end
- end
- if in2=loopgad then loopval=in3
- if in2=transgad then transval=in3
- if in2=kopie then kopieval=in3
- if in2=savegad then do
- savefile=in4 in5
- testButtons()
- end
- if in2=dispgad then do
- if in3=0 then disp="none"
- if in3=1 then disp="not"
- if in3=2 then disp="back"
- if in3=3 then disp="prev"
- end
- if in2=gifgad then do
- call readList()
- Eingabe='whirlgif -o 'savefile' -loop 'loopval' -disp 'disp
- if transparenz=1 then Eingabe=Eingabe||' -trans 'transval
- do i=1 to Anzahl
- Eingabe = Eingabe||' -time 'delay.i' 'pfad.i
- end
- echo Eingabe
- address command Eingabe
- end
- if in2=newgad then do
- call writeln(ca,'id 'filegad' s 1')
- parse value readln(ca) with ok '"' filename '"'
- if ok=0 then return(0)
- Anzahl=Anzahl+1
- testButtons()
- if kopieval=1 then do
- filename=getFilename(filename)
- end
- GID.Anzahl=topipe('id 'browser' addn gt="'filename'|^10" tar=-1')
- Nr=GID.Anzahl
- end
- if in2=browser then do
- Nr=in5
- if in3=16 & in4=0 then do
- call writeln(ca,'id 'Nr' read sort 1')
- delay = readln(ca)
- if kopieval=1 then do
- call writeln(ca,'id 'Nr' read sort 0')
- file = readln(ca)
- end
- call writeln(ca,'id 'filegad' s 1')
- parse value readln(ca) with ok '"' pfad '"'
- if ok~=0 then do
- if kopieval=1 then do
- address command 'delete "'file'"'
- pfad=getFilename(pfad)
- end
- call topipe('id 'Nr' gt "'pfad'|^'delay'"')
- end
- end
- end
- if in2=cleargad then do
- if kopieval=1 then call cleanUpTemp()
- call topipe('id 'browser' remn')
- Anzahl=0
- testButtons()
- end
- if in2=delgad then do
- call writeln(ca,'id 'Nr' read sort 0')
- file = readln(ca)
- if kopieval=1 then address command 'delete "'file'"'
- call topipe('id 'Nr' remn')
- Anzahl=Anzahl-1
- call neuOrdnen(Nr)
- testButtons()
- Nr=GID.Anzahl
- end
- return(0)
-
-
- getFilename:
- parse arg filestring
- if filestring~='""' then address command 'copy "'filestring'" t:'
- filestring=substr(filestring, index(filestring,':')+1,length(filestring)-index(filestring,':'))
- filestring='t:'||substr(filestring, lastpos('/',filestring)+1, length(filestring)-lastpos('/',filestring))
- return(filestring)
-
-
- testButtons:
- if length(savefile)>6 & Anzahl>1 then call topipe('id 'gifgad' dis 0 ref')
- else call topipe('id 'gifgad' dis 1 ref')
-
- if Anzahl>0 then do
- call topipe('id 'cleargad' dis 0 ref')
- call topipe('id 'delgad' dis 0 ref')
- call topipe('id 'savegad' dis 0 ref')
- call topipe('id 'browser' dis 0 ref')
- call topipe('id 'dispgad' dis 0 ref')
- call topipe('id 'checkers' dis 0 ref')
- call topipe('id 'loopgad' dis 0 ref')
- call topipe('id 'kopie' dis 1 ref')
- if transparenz=1 then call topipe('id 'transgad' dis 0 ref')
- end
- else do
- call topipe('id 'kopie' dis 0 ref')
- call topipe('id 'cleargad' dis 1 ref')
- call topipe('id 'delgad' dis 1 ref')
- call topipe('id 'savegad' dis 1 ref')
- call topipe('id 'browser' dis 1 ref')
- call topipe('id 'dispgad' dis 1 ref')
- call topipe('id 'checkers' dis 1 ref')
- call topipe('id 'transgad' dis 1 ref')
- call topipe('id 'loopgad' dis 1 ref')
- end
- return(0)
-
-
-
-
- readList:
- do i=1 to Anzahl
- call writeln(ca,'id 'GID.i' read sort 0')
- pfad.i = readln(ca)
- call writeln(ca,'id 'GID.i' read sort 1')
- delay.i = readln(ca)
- end
- return(0)
-
-
-
-
- cleanUpTemp:
- do i=1 to Anzahl
- call writeln(ca,'id 'GID.i' read sort 0')
- pfad.i = readln(ca)
- address command 'delete 'pfad.i
- end
- return(0)
-
-
-
-
- neuOrdnen:
- parse arg index
- do i=1 to Anzahl+2
- if GID.i=index then do
- treffer=i
- break
- end
- end
- do i=treffer to Anzahl
- GID.i=GID.i+1
- end
- return(0)
-
-
-
-
- topipe:
- parse arg out
- call writeln(ca,out)
- res=readln(ca)
- parse var res res1 res2 .
- if res1='ok' then return(res2)
- say 'error from: 'out
- say ' responce: ' res
- exit
-