home *** CD-ROM | disk | FTP | other *** search
- global gmode, gno, glefttopitemno, gkategorie, gviewlist, gfilelister
-
- on startMovie
- initmachine()
- setmanualmode()
- set gno to 0
- end
-
- on stopMovie
- clearGlobals()
- end
-
- on listlinkfile n, m
- repeat with i = n to m
- put the fileName of cast i
- end repeat
- end
-
- on quitbrowser
- quit()
- end
-
- on initmachine
- global gextension
- if the machineType = 256 then
- set gextension to ".BMP"
- else
- set gextension to ".pic"
- end if
- end
-
- on loadpictureforbrowser br, lno
- global gextension, gkategorie
- set l to finddata(br)
- if 0 < l then
- set gkategorie to br
- set kl to getmembersofkategorie(br)
- if lno < 0 then
- set lno to kl - 1
- else
- if kl <= lno then
- set lno to 0
- end if
- end if
- set fname to "gu:240x180:" & getfname(l + lno) & gextension
- set fshortname to getfname(l + lno) & gextension
- set f to fileio(mnew, "read", fname)
- if objectp(f) then
- set the picture of cast (gethv(l + lno) & "PICT240x180") to f(mreadpict)
- put fshortname into field "FileName"
- put l + lno into field "search"
- end if
- set gno to lno
- return lno
- end if
- return -1
- end
-
- on loadpictureforbrowserabs br, no
- global gextension
- set l to finddata(br)
- if 0 < no then
- set gkategorie to br
- set fname to "gu:240x180:" & getfname(no) & gextension
- set fshortname to getfname(no) & gextension
- set f to fileio(mnew, "read", fname)
- if objectp(f) then
- set the picture of cast (gethv(no) & "PICT240x180") to f(mreadpict)
- put fshortname into field "FileName"
- put no into field "search"
- end if
- set gno to no - l
- end if
- end
-
- on finddata br
- set l to the number of lines in field "data"
- repeat with i = 1 to l
- set p to item 2 of line i of field "data"
- if p = br then
- return i
- end if
- end repeat
- return 0
- end
-
- on gethv n
- if (n < 1) or (the number of lines in field "data" < n) then
- return EMPTY
- end if
- return item 3 of line n of field "data"
- end
-
- on getfname n
- if (n < 1) or (the number of lines in field "data" < n) then
- return EMPTY
- end if
- return item 1 of line n of field "data"
- end
-
- on getkategorie n
- if (n < 1) or (the number of lines in field "data" < n) then
- return EMPTY
- end if
- return item 2 of line n of field "data"
- end
-
- on getmembersofkategorie br
- set cnt to 0
- set l to the number of lines in field "data"
- repeat with i = finddata(br) to l
- set p to item 2 of line i of field "data"
- if p <> br then
- exit repeat
- end if
- set cnt to cnt + 1
- end repeat
- return cnt
- end
-
- on getno nm
- set l to the number of lines in field "data"
- repeat with i = 1 to l
- set p to item 1 of line i of field "data"
- if p = nm then
- return i
- end if
- end repeat
- return 0
- end
-
- on whichmode
- return gmode
- end
-
- on setmanualmode
- set gmode to #manual
- when timeOut then nothing
- radiobuttonoff()
- end
-
- on setautomode
- set gmode to #auto
- when timeOut then AutoView
- set the timeoutLength to 1 * 60
- radiobuttonon()
- end
-
- on finishautoview
- set gmode to #manual
- when timeOut then nothing
- puppetSprite(3, 0)
- end
-
- on autoview
- if whichmode() = #auto then
- set gno to gno + 1
- set gno to loadpictureforbrowser(getlabelname(), gno)
- end if
- end
-
- on radiobuttonon
- set sp to clickOn()
- if 0 < sp then
- puppetSound("Click")
- puppetSprite(sp, 1)
- set the ink of sprite sp to 2
- updateStage()
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end if
- end
-
- on radiobuttonoff
- set sp to clickOn()
- if 0 < sp then
- puppetSound("Click")
- puppetSprite(sp, 0)
- updateStage()
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end if
- end
-
- on prev
- if whichmode() = #manual then
- set gno to gno - 1
- set gno to loadpictureforbrowser(getlabelname(), gno)
- end if
- end
-
- on next
- if whichmode() = #manual then
- set gno to gno + 1
- set gno to loadpictureforbrowser(getlabelname(), gno)
- end if
- end
-
- on getlabelname
- set l to the labelList
- set n to the number of lines in l - 1
- repeat with i = 1 to n
- put "," & label(line i of l) after line i of l
- end repeat
- repeat with i = n down to 1
- if value(item 2 of line i of l) <= the frame then
- return item 1 of line i of l
- end if
- end repeat
- return EMPTY
- end
-
- on copytohdd
- global gextension
- unLoadCast(1, 116)
- set l to finddata(getlabelname())
- if 0 < l then
- set fname to "gu:" & field "sizehv" & ":" & getfname(l + gno) & gextension
- set fshortname to getfname(l + gno) & gextension
- set f to fileio(mnew, "read", fname)
- if objectp(f) then
- set len to f(mgetlength) + 200
- if len < the freeBlock then
- set d to fileio(mnew, "?write", fshortname)
- if objectp(d) then
- copyfileio(d, f)
- d(mdispose)
- end if
- else
- set msg to string(the freeBlock / 1024) & "Kbytes Memory available . But, need" && string(len / 1024) & "Kbytes ."
- alert(msg)
- end if
- f(mdispose)
- end if
- end if
- end
-
- on copyfileio dest, src
- dest(mwritestring, src(mreadfile))
- if the machineType <> 256 then
- dest(msetfinderinfo, "PICT", "????")
- end if
- end
-
- on initfullscreen
- global gextension
- preLoadCast(the number of cast "PICT640x480")
- set l to finddata(getlabelname())
- if 0 < l then
- set fname to "gu:640x480:" & getfname(l + gno) & gextension
- set f to fileio(mnew, "read", fname)
- if objectp(f) then
- set the picture of cast "PICT640x480" to f(mreadpict)
- end if
- end if
- end
-
- on search
- set br to getlabelname()
- set l to finddata(br)
- set m to l - 1 + getmembersofkategorie(br)
- set n to value(field "search")
- if (l <= n) and (n <= m) then
- loadpictureforbrowserabs(br, n)
- else
- beep()
- end if
- end
-
- on setupkategorie cate
- set gkategorie to cate
- set glefttopitemno to finddata(cate)
- if 0 < glefttopitemno then
- set data to prerairshowviewer()
- showviewer(data)
- end if
- end
-
- on initviewer
- repeat with i = 12 to 20
- puppetSprite(i, 1)
- end repeat
- set gfilelister to birth(script "FileIconLister", 44)
- end
-
- on finishviewer
- repeat with i = 12 to 20
- puppetSprite(i, 0)
- end repeat
- if objectp(gfilelister) then
- destroy(gfilelister)
- set gfilelister to 0
- end if
- end
-
- on resumeviewer
- initviewer()
- showviewer(gviewlist)
- show(gfilelister)
- end
-
- on hideviewer
- repeat with i = 12 to 20
- set the visible of sprite i to 0
- end repeat
- hide(gfilelister)
- updateStage()
- end
-
- on appearviewer
- repeat with i = 12 to 20
- set the visible of sprite i to 1
- end repeat
- showp(gfilelister)
- end
-
- on scrollup
- set data to prerairscrollupshowviewer()
- if data <> EMPTY then
- showviewer(data)
- set glefttopitemno to glefttopitemno + 3
- end if
- end
-
- on scrolldown
- set data to prerairscrolldownshowviewer()
- if data <> EMPTY then
- showviewer(data)
- set glefttopitemno to glefttopitemno - 3
- end if
- end
-
- on showviewer data
- repeat with i = 12 to 20
- set cname to line i - 11 of data
- set the castNum of sprite i to the number of cast cname
- end repeat
- set gviewlist to data
- updateStage()
- end
-
- on prerairshowviewer
- set p to 0
- set n to glefttopitemno
- set l to EMPTY
- repeat with i = 1 to 9
- set cate to getkategorie(n + i - 1)
- if (cate = gkategorie) and (cate <> EMPTY) then
- set p to 1
- set cname to getfname(n + i - 1) & ".pic"
- else
- set cname to "dummy120x90"
- end if
- put cname & RETURN after l
- end repeat
- if p then
- return l
- else
- return EMPTY
- end if
- end
-
- on prerairscrollupshowviewer
- set p to 0
- set n to glefttopitemno + 3
- set l to EMPTY
- repeat with i = 1 to 9
- set cate to getkategorie(n + i - 1)
- if (cate = gkategorie) and (cate <> EMPTY) then
- set p to 1
- set cname to getfname(n + i - 1) & ".pic"
- else
- set cname to "dummy120x90"
- end if
- put cname & RETURN after l
- end repeat
- if p then
- return l
- else
- return EMPTY
- end if
- end
-
- on prerairscrolldownshowviewer
- set p to 0
- set n to glefttopitemno - 3
- set l to EMPTY
- repeat with i = 1 to 9
- set cate to getkategorie(n + i - 1)
- if (cate = gkategorie) and (cate <> EMPTY) then
- set p to 1
- set cname to getfname(n + i - 1) & ".pic"
- else
- set cname to "dummy120x90"
- end if
- put cname & RETURN after l
- end repeat
- if p then
- return l
- else
- return EMPTY
- end if
- end
-