home *** CD-ROM | disk | FTP | other *** search
- global gMode, gNo
-
- on startMovie
- InitMachine
- SetManualMode
- set gNo = 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
- -- some enviroments should be resumed .
- -- but this version quits simply .
- quit
- end
- ---
- on InitMachine
- global gExtension
- if (the machineType = 256) then
- set gExtension = ".BMP"
- else
- set gExtension = ".pic"
- end if
- end
-
- --
- on LoadPictureForBrowser br, lno
- global gExtension
- --set the trace = TRUE
-
- set l = FindData( br )
- if (0 < l) then
- set kl = GetMembersOfKategorie( br )
- if (lno < 0) then
- set lno = kl -1
- else if (kl <= lno) then
- set lno = 0
- end if
-
- --
- set fname = "gu:240x180:" & GetFName( l + lno ) & gExtension
- set fshortname = GetFName( l + lno ) & gExtension
- set f = FileIO(mNew, "read", fname )
- if (objectp(f)) then
- set the picture of cast (GetHV( l + lno ) & "PICT240x180") = f(mReadPict)
- put fshortname into field "FileName"
- put (l + lno) into field "search"
- end if
- set gNo = lno
- --set the trace = FALSE
- return lno
- end if
- -- set the trace = FALSE
- return -1
- end
- on LoadPictureForBrowserAbs br, no
- global gExtension
-
- set l = FindData( br )
- if (0 < no) then
- set fname = "gu:240x180:" & GetFName( no ) & gExtension
- set fshortname = GetFName( no ) & gExtension
- set f = FileIO(mNew, "read", fname )
- if (objectp(f)) then
- set the picture of cast (GetHV( no ) & "PICT240x180") = f(mReadPict)
- put fshortname into field "FileName"
- put (no) into field "search"
- end if
- set gNo = no - l
- end if
- end
-
- ----
- on FindData br
- set l = the number of lines of field "data"
- repeat with i = 1 to l
- set p = 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 of field "data" < n) then return EMPTY
- return item 3 of line n of field "data"
- end
- on GetFName n
- if (n < 1 or the number of lines of field "data" < n) then return EMPTY
- return item 1 of line n of field "data"
- end
- on GetKategorie n
- if (n < 1 or the number of lines of field "data" < n) then return EMPTY
- return item 2 of line n of field "data"
- end
- on GetMembersOfKategorie br
- set cnt = 0
- set l = the number of lines of field "data"
- repeat with i = FindData( br ) to l
- set p = item 2 of line i of field "data"
- if (p <> br) then
- exit repeat
- end if
- set cnt = cnt + 1
- end repeat
- return cnt
- end
- on GetNo nm
- set l = the number of lines of field "data"
- repeat with i = 1 to l
- set p = item 1 of line i of field "data"
- if (p = nm) then
- return i
- end if
- end repeat
- return 0
- end
- ---
- -- browser modes
- on whichMode
- return gMode
- end
- on SetManualMode
- set gMode = #MANUAL
- when timeOut then nothing
- RadioButtonOFF
- end
- on SetAutoMode
- set gMode = #AUTO
- when timeOut then AutoView
- set the timeoutLength = 1 * 60
- RadioButtonOn
- end
- --
- on FinishAutoView
- set gMode = #MANUAL
- when timeOut then nothing
- puppetSprite 3, FALSE -- <----
- updatestage
- end
- --
- on AutoView
- if (whichMode() = #AUTO) then
- set gNo = gNo + 1
- set gNo = LoadPictureForBrowser( getLabelName(), gNo )
- end if
- end
- ----
- on RadioButtonOn
- set sp = ClickOn()
- if (0 < sp) then
- puppetSound "Click"
- puppetSprite sp, TRUE
- set the ink of sprite sp = 2
- updatestage
- --
-
- repeat while soundBusy(1)
- end repeat
-
- --
- puppetSound 0
- end if
- end
- on RadioButtonOFF
- set sp = ClickOn()
- if (0 < sp) then
- puppetSound "Click"
- puppetSprite sp, FALSE
- updatestage
- --
-
- repeat while soundBusy(1)
- end repeat
-
- --
- puppetSound 0
- end if
- end
-
- ---
- on Prev
- if (whichMode() = #MANUAL) then
- set gNo = gNo - 1
- set gNo = LoadPictureForBrowser( getLabelName(), gNo )
- end if
- end
- on Next
- if (whichMode() = #MANUAL) then
- set gNo = gNo + 1
- set gNo = LoadPictureForBrowser( getLabelName(), gNo )
- end if
- end
- --
- on getLabelName
- set l = the labelList
- set n = (the number of lines of 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 = FindData( getLabelName() )
- if (0 < l) then
- set fname = "gu:"& (field "sizehv") & ":" & GetFName( l + gNo ) & gExtension
- set fshortname = GetFName( l + gNo ) & gExtension
- set f = FileIO(mNew, "read", fname )
- if (objectp(f)) then
- set len = f( mGetLength ) + 200
- -- put len && the freeBytes
- if (len < the freeBlock) then
- set d = FileIO( mNew, "?write", fshortname )
- -- put d
- if (objectp( d )) then
- copyFileIO( d, f )
- d( mDispose )
- end if
- else
- set msg = 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
- --
- on initFullScreen
- global gExtension
-
- set l = FindData( getLabelName() )
- if (0 < l) then
- set fname = "gu:640x480:" & GetFName( l + gNo ) & gExtension
- set f = FileIO(mNew, "read", fname )
- if (objectp(f)) then
- set the picture of cast ("PICT640x480") = f(mReadPict)
- end if
- end if
- end
- --
- on search
- set br = getLabelName()
- set l = FindData( br )
- set m = l - 1 + GetMembersOfKategorie( br )
- set n = value( field "search" )
- if (l <= n and n <= m) then
- LoadPictureForBrowserAbs br, n
- else
- beep
- end if
- end
- ----------------------------
- --
- --
- global gLeftTopItemNo, gKategorie, gViewList, gFileLister
- on SetupKategorie cate
- set gKategorie = cate
- set gLeftTopItemNo = FindData( cate )
- if (0 < gLeftTopItemNo) then
- set data = prerairShowViewer()
- ShowViewer( data )
- end if
- end
- on initViewer
- repeat with i = 12 to 20
- puppetsprite i, TRUE
- end repeat
- --
- set gFileLister = birth( script"FileIconLister", 44 )
- end
- on finishViewer
- repeat with i = 12 to 20
- puppetsprite i, FALSE
- end repeat
- if (objectp(gFileLister)) then
- destroy( gFileLister )
- set gFileLister = 0
- end if
- end
- on resumeViewer
- initViewer
- ShowViewer( gViewList )
- --set the trace = TRUE
- show( gFileLister )
- --set the trace = FALSE
- end
-
- on hideViewer
- repeat with i = 12 to 20
- set the visible of sprite i = FALSE
- end repeat
- hide( gFileLister )
- updateStage
- end
- on appearViewer
- repeat with i = 12 to 20
- set the visible of sprite i = TRUE
- end repeat
- showp( gFileLister )
- end
-
- on ScrollUp
- set data = prerairScrollUpShowViewer()
- if (data <> EMPTY) then
- ShowViewer( data )
- set gLeftTopItemNo = gLeftTopItemNo + 3
- end if
- end
- on ScrollDown
- set data = prerairScrollDownShowViewer()
- if (data <> EMPTY) then
- ShowViewer( data )
- set gLeftTopItemNo = gLeftTopItemNo - 3
- end if
- end
-
- on ShowViewer data
- repeat with i = 12 to 20
- set cName = line (i - 11) of data
- set the castNum of sprite i = the number of cast cName
- end repeat
- set gViewList = data
- updateStage
- end
-
- on prerairShowViewer
- set p = FALSE
- set n = gLeftTopItemNo
- set l = ""
- repeat with i = 1 to 9
- set cate = GetKategorie( n + i - 1 )
- if ((cate = gKategorie) and (cate <> EMPTY)) then
- set p = TRUE
- set cName = GetFName( n + i - 1 ) & ".pic"
- else
- set cName = "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 = FALSE
- set n = gLeftTopItemNo + 3 -- inc
- set l = ""
- repeat with i = 1 to 9
- set cate = GetKategorie( n + i - 1 )
-
- if ((cate = gKategorie) and (cate <> EMPTY)) then
- set p = TRUE
- set cName = GetFName( n + i - 1 ) & ".pic"
- else
- set cName = "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 = FALSE
- set n = gLeftTopItemNo - 3 -- dec
- set l = ""
- repeat with i = 1 to 9
- set cate = GetKategorie( n + i - 1 )
-
- if ((cate = gKategorie) and (cate <> EMPTY)) then
- set p = TRUE
- set cName = GetFName( n + i - 1 ) & ".pic"
- else
- set cName = "dummy120x90"
- end if
- put cName & RETURN after l
- end repeat
- if (p) then
- return l
- else
- return EMPTY
- end if
- end
-