REVO2700&Image browserP on changeFolder pFolder set the folder to pFolder put the folder into field "lblFolder" put the folders into field "Folders" sort lines of field "Folders" end changeFolder on preOpenStack send "resetImages" to group 1 send "changeFolder " & the folder end preOpenStack |  U Helvetica W HelveticacREVGeometryCachestackID6834cRevStandaloneSettings7scriptLibrariesInternet Geometry PrintingMacOSXfalse OSX,name Image browserMacOS,documentTypeUNIX,fileSelectortrueWindowsfalseWindows,LegalCopyright#2007 All rights reserved worldwideMacOS,longVersionImage browser 1.0.0.0UNIX,pageSetuptrueSolaris SPARCfalseOSX,documentTypeLinuxtrue inclusionssearchWindows,documenticonFile\/home/tim/Projects/Revolution/ide/Runtime/Windows/x86-32/Support/Sample Icons/genericdoc.ico answerDialogtrueOSX,documentExtensionWindows,FileDescription!Image browser 1.0.0.0 for WindowsOSX,longVersionImage browser 1.0.0.0 MacOSfatfalseWindows,buildU3falseOSX,copyright#2007 All rights reserved worldwideUNIX,printerChoosertrueMacOS,MinimumSize15000MacOS,versionnumber11MacOS,versionnumber20MacOS,ReleaseFinalOSX,identifiercom..imagebrowsername Image browserMacOS,versionnumber30Solaris Intelfalse MacOS,Region1OSX,shortVersion1.0.0.0Windows,fileversion11Windows,productversion11Windows,fileversion20Windows,productversion20Windows,fileversion30cursorsfalseWindows,productversion30Windows,fileversion40Windows,productversion40 OSX,infoImage browser Version 1.0.0.0 MacOS68kfalseMacOSX PowerPC-32falseMacOS,dynamicMemorytrue askDialogtrueOSX,signature????Windows,iconFile\/home/tim/Projects/Revolution/ide/Runtime/Windows/x86-32/Support/Sample Icons/genericapp.icoMacOS,PreferredSize15000Windows,ProductName Image browserUNIX,colorChoosertrueMacOSX x86-32false MacOSPPCfalseWindows,companynameMacOS,creator???? cREVGeneral scriptChecksum7&: 2} debugObjects handlerListchangeFolder preOpenStackscriptSelectionchar 182 to 181 bookmarks tempScript prevHandler changeFolderstackfileversion2.7script

on changeFolder pFolder

set the folder to pFolder

put the folder into field "lblFolder"

put the folders into field "Folders"

sort lines of field "Folders"

end changeFolder

on preOpenStack

send "resetImages" to group 1

send "changeFolder " & the folder

end preOpenStack

 @|cREVGeometryCacheIDs 119280614063815281193410587307414511928072619311841119280733529018421193410549131414411928048802531152119341119186741481193410647467414711934106353454146cREVGeometrycacheorder total9 cREVGeneral bookmarks handlerList tempScript prevHandlerscript123thumbnailView i0-- Holds a count of the number of images loaded into the thumbnail viewer and is used to calculate the top position -- of additional images. local sImages ############################################################################### # # reloadThumbnails # Lists the images in the current folder and displays thumbnails (either from the cache if available # or by creating them). # on reloadThumbnails -- First of all, need to cancel the pending messages. This stop us from processing any more thumbnails -- from a previous call to reloadThumbnails. repeat until the pendingMessages is empty cancel item 1 of line 1 of the pendingMessages end repeat local tFiles -- Set up the default properties for the templateImage. This means that any image created will -- have these properties set automatically. set the width of the templateImage to 100 set the height of the templateImage to 100 set the border of the templateImage to true set the threeD of the templateImage to false set the borderwidth of the templateImage to 1 set the locklocation of the templateImage to true -- We set the custom property "cPreviewImage" to true to allow us to loop through all controls in -- the stack and find images that belong to the thumbnail . Used to delete thumbnails. set the cPreviewImage of the templateImage to true -- Get a list of all the image files (JPEG, GIF and PNG) in the current folder. local tAllFiles local tAFile put the files into tAllFiles put empty into tFiles repeat for each line tAFile in tAllFiles if toUpper(tAFile) contains ".JPG" or toUpper(tAFile) contains ".GIF" or toUpper(tAFile) contains ".PNG" then put tAfile & return after tFiles end if end repeat filter tFiles without "*_thumb" -- Update the status, telling the status group the number of items (images) we will be processing local tFileCount; put the number of lines in tFiles into tFileCount send "statusMsg " & quote & "Updating the thumbnails..." & quote to group "grpStatus" send "statusProgress " & tFileCount & ",0" to group "grpStatus" -- Start off the processImage send loop send "processImage tFiles" to me in 0 millisecs end reloadThumbnails ######################################################################################### # # resetImages # Deletes all the images from the group, using the "cPreviewImage" custom property to deceide if the image # belongs to the thumbnail group. on resetImages local a -- Lock the screen so that this is nice and fast lock screen -- Reset the number of images we hold put 0 into sImages -- Loop through all the controls in the stack. NOTE: we have to loop downwards to zero as we may be -- removing controls while in the loop - not doing this causes Badness. repeat with a = the number of controls down to 1 -- Check the custom property "cPreviewControl" to see if this control is a thumbnail image and delete it. if the cPreviewImage of control a is true then delete control a end repeat unlock screen end resetImages ####################################################################################### # # newImage # This is a handler that the system calls whenever a new image is created in this group. By using this handler # we can put in code to place the new image at a specific location, thus the calling objects/application does # not need to think about this -- it can just create a new image in this group and know that the positioning will # be handled automatically by this group. on newImage -- Grab the ID of the new image into a local variable local tID put the target into tID -- Set the top and the left of the new image based upon the number of images that we currently have in -- out group. set the top of tID to ( the height of tID + 5 ) * sImages set the left of tID to the left of me + 5 put sImages + 1 into sImages end newImage ##################################################################################### # # mouseUp # The group will get passed this message whenever an image in the group is clicked. The Target will be the # image that was clicked. # We use the cFilename custom property of the image (set in processImage) to get the original filename that # the thumbnail represents. We can then set the main images filename to the original. on mouseUp local tID put the target into tID send "statusMsg " & quote & "Rendering image : " & the cFilename of tID & quote to group "grpStatus" set the filename of image "BigImage" to the cFilename of tID send "statusMsg Done" to group "grpStatus" end mouseUp ##################################################################################### # # processImage # This handler is not called directly. Rather is is called in a "send" message loop. It calls iteself once for each # file in a list with a slight delay - 25 milliseconds. Doing things using a send loop like this (rather than a tight # repeat loop) allows the application to remain responsive to other events while processing the thumbnails. on processImage pImageList local tFile -- Get the file file from the list put line 1 of pImageList into tFile send "statusInc" to group "grpStatus" -- Create a new image in the thumbnails group. The newImage handler of the group will look after the positioning -- of the new image . create image in group "thumbnailView" local tID put the id of the last image of group "thumbnailView" into tID -- Set the custom property "cFilename" of this new thumbnail image to the original file that this thumbnail is -- representing. set the cFilename of image id tID to tFile -- Make the filename for the thumbnail cache item. I have started the filename with at "." as Linux hides these -- files by default. local tThumbFile put "." & tFile & "_thumb" into tThumbFile -- If the thumbnail cache file exists, then simply set the filename of the new thumbnail image to be the cached -- thumbnail item. if there is a file tThumbFile then set the filename of image id tID to tThumbFile else --We need to create a new thumbnail image. -- First, create a new image and set the filename of that new image to the image file. create invisible image "Foo" set the filename of image "Foo" to tFile lock screen -- We want the thumbnail image to be a smaller version of the main image --- not just a scaled down version. -- Use "import snapshot" to grab a snapshot of the scaled down image import snapshot from rect (the rect of image "Foo") of image "Foo" -- Now set the data of the thumbnail image to be the data of the snapshot. set the text of image id tID to the text of the last image -- Delete the snapshot image delete the last image unlock screen -- Delete the temporary image delete image "Foo" -- Make the filename of the cache image local tCacheFile put "binfile:"&tThumbFile into tCacheFile -- Same the thumbnail cache image. put the text of image id tID into URL tCacheFile end if -- Remove the first list from the list of image files - this is the filename we have just processed. delete line 1 of pImageList -- If we still have more files to process, then send the "processImage" message to myself with the remainder -- of the files list in 25 milliseconds. This allows other message processing (such as mouse clicks etc) to occur. if pImageList is not empty then send "processImage pImageList" to me in 25 millisecs end if end processImage bordertrue cREVGeneralscriptChecksum['!, revUniqueID 1192804880253 bookmarks handlerList:reloadThumbnails resetImages newImage mouseUp processImage tempScript prevHandlernewImagescriptSelectionchar 141 to 140scriptB"

-- Holds a count of the number of images loaded into the thumbnail viewer and is used to calculate the top position

-- of additional images.

local sImages

###############################################################################

#

# reloadThumbnails

# Lists the images in the current folder and displays thumbnails (either from the cache if available

# or by creating them).

#

on reloadThumbnails

-- First of all, need to cancel the pending messages. This stop us from processing any more thumbnails

-- from a previous call to reloadThumbnails.

repeat until the pendingMessages is empty

cancel item 1 of line 1 of the pendingMessages

end repeat

local tFiles

-- Set up the default properties for the templateImage. This means that any image created will

-- have these properties set automatically.

set the width of the templateImage to 100

set the height of the templateImage to 100

set the border of the templateImage to true

set the threeD of the templateImage to false

set the borderwidth of the templateImage to 1

set the locklocation of the templateImage to true

-- We set the custom property "cPreviewImage" to true to allow us to loop through all controls in

-- the stack and find images that belong to the thumbnail . Used to delete thumbnails.

set the cPreviewImage of the templateImage to true

-- Get a list of all the image files (JPEG, GIF and PNG) in the current folder.

local tAllFiles

local tAFile

put the files into tAllFiles

put empty into tFiles

repeat for each line tAFile in tAllFiles

if toUpper(tAFile) contains ".JPG" or toUpper(tAFile) contains ".GIF" or toUpper(tAFile) contains ".PNG" then

put tAfile & return after tFiles

end if

end repeat

filter tFiles without "*_thumb"

-- Update the status, telling the status group the number of items (images) we will be processing

local tFileCount;

put the number of lines in tFiles into tFileCount

send "statusMsg " & quote & "Updating the thumbnails..." & quote to group "grpStatus"

send "statusProgress " & tFileCount & ",0" to group "grpStatus"

-- Start off the processImage send loop

send "processImage tFiles" to me in 0 millisecs

end reloadThumbnails

#########################################################################################

#

# resetImages

# Deletes all the images from the group, using the "cPreviewImage" custom property to deceide if the image

# belongs to the thumbnail group.

on resetImages

local a

-- Lock the screen so that this is nice and fast

lock screen

-- Reset the number of images we hold

put 0 into sImages

-- Loop through all the controls in the stack. NOTE: we have to loop downwards to zero as we may be

-- removing controls while in the loop - not doing this causes Badness.

repeat with a = the number of controls down to 1

-- Check the custom property "cPreviewControl" to see if this control is a thumbnail image and delete it.

if the cPreviewImage of control a is true then delete control a

end repeat

unlock screen

end resetImages

#######################################################################################

#

# newImage

# This is a handler that the system calls whenever a new image is created in this group. By using this handler

# we can put in code to place the new image at a specific location, thus the calling objects/application does

# not need to think about this -- it can just create a new image in this group and know that the positioning will

# be handled automatically by this group.

on newImage

-- Grab the ID of the new image into a local variable

local tID

put the target into tID

-- Set the top and the left of the new image based upon the number of images that we currently have in

-- out group.

set the top of tID to ( the height of tID + 5 ) * sImages

set the left of tID to the left of me + 5

put sImages + 1 into sImages

end newImage

#####################################################################################

#

# mouseUp

# The group will get passed this message whenever an image in the group is clicked. The Target will be the

# image that was clicked.

# We use the cFilename custom property of the image (set in processImage) to get the original filename that

# the thumbnail represents. We can then set the main images filename to the original.

on mouseUp

local tID

put the target into tID

send "statusMsg " & quote & "Rendering image : " & the cFilename of tID & quote to group "grpStatus"

set the filename of image "BigImage" to the cFilename of tID

send "statusMsg Done" to group "grpStatus"

end mouseUp

#####################################################################################

#

# processImage

# This handler is not called directly. Rather is is called in a "send" message loop. It calls iteself once for each

# file in a list with a slight delay - 25 milliseconds. Doing things using a send loop like this (rather than a tight

# repeat loop) allows the application to remain responsive to other events while processing the thumbnails.

on processImage pImageList

local tFile

-- Get the file file from the list

put line 1 of pImageList into tFile

send "statusInc" to group "grpStatus"

-- Create a new image in the thumbnails group. The newImage handler of the group will look after the positioning

-- of the new image .

create image in group "thumbnailView"

local tID

put the id of the last image of group "thumbnailView" into tID

-- Set the custom property "cFilename" of this new thumbnail image to the original file that this thumbnail is

-- representing.

set the cFilename of image id tID to tFile

-- Make the filename for the thumbnail cache item. I have started the filename with at "." as Linux hides these

-- files by default.

local tThumbFile

put "." & tFile & "_thumb" into tThumbFile

-- If the thumbnail cache file exists, then simply set the filename of the new thumbnail image to be the cached

-- thumbnail item.

if there is a file tThumbFile then

set the filename of image id tID to tThumbFile

else

--We need to create a new thumbnail image.

-- First, create a new image and set the filename of that new image to the image file.

create invisible image "Foo"

set the filename of image "Foo" to tFile

lock screen

-- We want the thumbnail image to be a smaller version of the main image --- not just a scaled down version.

-- Use "import snapshot" to grab a snapshot of the scaled down image

import snapshot from rect (the rect of image "Foo") of image "Foo"

-- Now set the data of the thumbnail image to be the data of the snapshot.

set the text of image id tID to the text of the last image

-- Delete the snapshot image

delete the last image

unlock screen

-- Delete the temporary image

delete image "Foo"

-- Make the filename of the cache image

local tCacheFile

put "binfile:"&tThumbFile into tCacheFile

-- Same the thumbnail cache image.

put the text of image id tID into URL tCacheFile

end if

-- Remove the first list from the list of image files - this is the filename we have just processed.

delete line 1 of pImageList

-- If we still have more files to process, then send the "processImage" message to myself with the remainder

-- of the files list in 25 milliseconds. This allows other message processing (such as mouse clicks etc) to occur.

if pImageList is not empty then

send "processImage pImageList" to me in 25 millisecs

end if

end processImage

 `y.IMG_0925.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0925.JPGbordertrue.IMG_0925.JPG_thumb.IMG_0942.JPG_thumb@nddcPreviewImagetrue cFilename IMG_0942.JPGbordertrue.IMG_0942.JPG_thumb.IMG_0938.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0938.JPGbordertrue.IMG_0938.JPG_thumb.IMG_0939.JPG_thumb@@ddcPreviewImagetrue cFilename IMG_0939.JPGbordertrue.IMG_0939.JPG_thumb.IMG_0922.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0922.JPGbordertrue.IMG_0922.JPG_thumb.P9250061.JPG_thumb@ddcPreviewImagetrue cFilename P9250061.JPGbordertrue.P9250061.JPG_thumb.IMG_0931.JPG_thumb@{ddcPreviewImagetrue cFilename IMG_0931.JPGbordertrue.IMG_0931.JPG_thumb.IMG_0944.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0944.JPGbordertrue.IMG_0944.JPG_thumb.IMG_0927.JPG_thumb@MddcPreviewImagetrue cFilename IMG_0927.JPGbordertrue.IMG_0927.JPG_thumb.IMG_0920.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0920.JPGbordertrue.IMG_0920.JPG_thumb.IMG_0943.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0943.JPGbordertrue.IMG_0943.JPG_thumb.IMG_0928.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0928.JPGbordertrue.IMG_0928.JPG_thumb .IMG_0924.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0924.JPGbordertrue.IMG_0924.JPG_thumb!.IMG_0945.JPG_thumb@ZddcPreviewImagetrue cFilename IMG_0945.JPGbordertrue.IMG_0945.JPG_thumb".IMG_0940.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0940.JPGbordertrue.IMG_0940.JPG_thumb#.IMG_0930.JPG_thumb@,ddcPreviewImagetrue cFilename IMG_0930.JPGbordertrue.IMG_0930.JPG_thumb$.IMG_0918.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0918.JPGbordertrue.IMG_0918.JPG_thumb%.IMG_0937.JPG_thumb@ddcPreviewImagetrue cFilename IMG_0937.JPGbordertrue.IMG_0937.JPG_thumb&.P9250056.JPG_thumb@gddcPreviewImagetrue cFilename P9250056.JPGbordertrue.P9250056.JPG_thumb BigImage`$  IMG_0940.JPG cREVGeneral revUniqueID 1192806140638 1Folders)pon mouseUp local tFolder local tNewFolder put the folder into tFolder put the selectedtext into tNewFolder -- The changeFolder handler is in the stack script. changeFolder tNewFolder send "resetImages" to group 1 send "reloadThumbnails" to group 1 end mouseUp $ cREVTable currentview cREVGeneralscriptChecksumr tuW=*K~ revUniqueID 1192807261931 bookmarks handlerListmouseUp tempScript prevHandler changeFolderscriptSelectionchar 172 to 171script

on mouseUp

local tFolder

local tNewFolder

put the folder into tFolder

put the selectedtext into tNewFolder

-- The changeFolder handler is in the stack script.

changeFolder tNewFolder

send "resetImages" to group 1

send "reloadThumbnails" to group 1

end mouseUp

..3 `@j%p a@ 2 lblFolder  p cREVTable currentview None selected cREVGeneral revUniqueID 1192807335290 /home/tim/Photos/2007/09/253 grpStatus $i0local sVal local sMax on statusMsg pMsg put pMsg into field "lblStatus" end statusMsg on statusProgress pMax, pVal put pVal into sVal put pMax into sMax set the endValue of scrollbar "pb" to pMax updateStatus end statusProgress on statusInc put sVal + 1 into sVal updateStatus end statusInc command updateStatus set the thumbPosition of scrollbar "pb" to sVal put "On item " & sVal & " of " & sMax into field "lblProgress" end updateStatus @Working status cREVGeneralscriptChecksumd5.?6ǐY revUniqueID 1193410647467 bookmarks handlerList/statusMsg statusProgress statusInc updateStatus tempScript prevHandler statusMsgscriptSelectionchar 243 to 308script'

local sVal

local sMax

on statusMsg pMsg

put pMsg into field "lblStatus"

end statusMsg

on statusProgress pMax, pVal

put pVal into sVal

put pMax into sMax

set the endValue of scrollbar "pb" to pMax

updateStatus

end statusProgress

on statusInc

put sVal + 1 into sVal

updateStatus

end statusInc

command updateStatus

set the thumbPosition of scrollbar "pb" to sVal

put "On item " & sVal & " of " & sMax into field "lblProgress"

end updateStatus

0 < cREVTable currentviewStatus : cREVGeneral revUniqueID 1193410549131 Status : 1 lblStatus  cREVTable currentviewUnknown status right now cREVGeneral revUniqueID 1193410587307 done2pbia19 cREVGeneral revUniqueID 1193410635345 4 lblProgress  cREVTable currentview cREVGeneral revUniqueID 1193411191867 On item 19 of 19