#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" <PictureChooser3ˆuÜon closeStackRequest end closeStackRequest on preOpenStack -- center the stack on the main screen Global MyDir put the defaultfolder into MyDir show_drives set the loc of this stack to the screenLoc set the left of this stack to 0 set the top of this stack to 28 resizeStack pass preOpenStack end preOpenStack on resumeStack Global AdjustingWindow if AdjustingWindow = 1 then pass resumeStack Global Init Global ScreenInfo Global ScreenWidth Global ScreenHeight Global GapOnRight ----------------------------------------------------------------------------------------- Global GotPathAlready if GotPathAlready = 0 then resizeStack --******************* end if end resumeStack on resizeStack Global AdjustingWindow if AdjustingWindow = 1 then pass resizeStack Global Init Global ScreenInfo Global ScreenWidth Global ScreenHeight Global GapOnRight if Init = 1 then Global WidgetWidth Global WidgetHeight Position_Controls pass resizeStack --************** end if put the screenRect into ScreenInfo ----By default, the itemdelimeter is set to "," put item 3 of ScreenInfo into ScreenWidth put item 4 of ScreenInfo into ScreenHeight set the left of image "Image1" to 0 set the top of image "Image1" to 0 -------------------------------------------------------------------------------------------- --Card1: set the left of field "List1" of card "Card1" to 50 set the top of field "List1" of card "Card1" to 65 set the height of field "List1" of card "Card1" to ScreenHeight - 200 set the width of field "List1" of card "Card1" to 50 * (ScreenWidth / 100) set the height of field "List2" of card "Card1" to the height of field "List1" of card "Card1" set the top of field "List2" of card "Card1" to the top of field "List1" of card "Card1" set the left of field "List2" of card "Card1" to the right of field "List1" of card "Card1" put (ScreenWidth - the left of field "List2" of card "Card1") into GapOnRight set the width of field "List2" of card "Card1" to GapOnRight - 50 show_drives get_ini_parameters call mouseDown of field "DriveField" of card "Card1" delete line 1 of field "List1" of card "Card1" --------------------------------------------------- Global SourceDirectory$ --e.g. c:\ Global StartupPath$ --e.g. c:\francis\posto if the number of chars in StartupPath$ > the number of chars in SourceDirectory$ then get_startup_folder end if --------------------------------------------------- Global InitialLeftOfPreviewBox Global InitialTopOfPreviewBox Global InitialWidthOfPreviewBox Global InitialHeightOfPreviewBox put the left of image "Preview" into InitialLeftOfPreviewBox put the top of image "Preview" into InitialTopOfPreviewBox put the width of image "Preview" into InitialWidthOfPreviewBox put the height of image "Preview" into InitialHeightOfPreviewBox put 1 into Init end resizeStack ---------------------------------------------------------------------------------------------- on show_drives Global AdjustingWindow if AdjustingWindow = 1 then pass show_drives Global DoingDiskError if DoingDiskError = 1 then put 0 into DoingDiskError pass show_drives end if call mouseDown of field "DriveField" of card "Card1" end show_drives ---------------------------------------------------------------------------------------------- on get_ini_parameters Global AdjustingWindow if AdjustingWindow = 1 then pass get_ini_parameters Global SourceDirectory$ Global IndentSize Global TreeFontname$ Global TreeFontsize Global TreeFontbold$ Global TreeFontitalic$ Global NumberOfDrives Global tempForeColour Global tempBackColour Global WidgetWidth Global WidgetHeight Global ProgramWindowIsMinimized if ProgramWindowIsMinimized = 1 then put 0 into ProgramWindowIsMinimized pass get_ini_parameters end if set the left of image "Image1" of card "Card1" to 0 set the top of image "Image1" of card "Card1" to 0 put URL "file:_picture_chooser.ini" into field "IniParametersField" of card "Card4" of this stack ----------------------------------------- --Startup drive (e.g. Windows only c:\): --In Linux, startup folders can begin as follows: --/ --/media/floppy0 or just "floppy" or "diskette" --/media/cdrom0 or just "cd" or "cdrom" --In the above optional startup drive specifications, you need to check for UCase, trailing slashes, etc. --Specifications such as floppy/subfolder should not be permitted. These should be specified as /media/floppy0/subfolder --Number of spaces for indents (e.g. 8): --Fontname (e.g. Arial): --Fontsize (e.g. 12): --Bold (yes or no): --Italic (yes or no): --Window left position (nnn or centre or center): --Window right position (nnn or centre or center): --Window width (nnn - min=320): --Window height (nnn - min=240): ----------------------------------------- --go Card4 --TEMP ONLY put line 1 of field "IniParametersField" of card "Card4" of this stack into SourceDirectory$ --e.g. "c:\" SourceDirectory$ if the charToNum of the last char of SourceDirectory$ is 13 then --LINUX only put char 1 to -2 of SourceDirectory$ into SourceDirectory$ end if --/ --/media/floppy0 or just "floppy" or "diskette" --/media/cdrom0 or just "cd" or "cdrom" if toLower(SourceDirectory$) = "floppy" then put "/media/floppy0" into SourceDirectory$ if toLower(SourceDirectory$) = "diskette" then put "/media/floppy0" into SourceDirectory$ if toLower(SourceDirectory$) = "cd" then put "/media/cdrom0" into SourceDirectory$ if toLower(SourceDirectory$) = "cdrom" then put "/media/cdrom0" into SourceDirectory$ if toLower(SourceDirectory$) = "/media/floppy0/" then put "/media/floppy0" into SourceDirectory$ if toLower(SourceDirectory$) = "/media/cdrom0/" then put "/media/cdrom0" into SourceDirectory$ put line 2 of field "IniParametersField" of card "Card4" of this stack into IndentSize --e.g. 8 IndentSize put line 3 of field "IniParametersField" of card "Card4" of this stack into TreeFontname$ --e.g. "Arial" TreeFontname$ put line 4 of field "IniParametersField" of card "Card4" of this stack into TreeFontsize --e.g. 12 TreeFontsize put line 5 of field "IniParametersField" of card "Card4" of this stack into TreeFontbold$ --e.g. "yes" TreeFontbold$ put line 6 of field "IniParametersField" of card "Card4" of this stack into TreeFontitalic$ --e.g. "no" TreeFontitalic$ if the charToNum of the last char of IndentSize is 13 then --LINUX only put char 1 to -2 of IndentSize into IndentSize end if if the charToNum of the last char of TreeFontname$ is 13 then --LINUX only put char 1 to -2 of TreeFontname$ into TreeFontname$ end if if the charToNum of the last char of TreeFontsize is 13 then --LINUX only put char 1 to -2 of TreeFontsize into TreeFontsize end if if the charToNum of the last char of TreeFontbold$ is 13 then --LINUX only put char 1 to -2 of TreeFontbold$ into TreeFontbold$ end if if the charToNum of the last char of TreeFontitalic$ is 13 then --LINUX only put char 1 to -2 of TreeFontitalic$ into TreeFontitalic$ end if put word 1 to -1 of SourceDirectory$ into SourceDirectory$ Global StartupPath$ put SourceDirectory$ into StartupPath$ --e.g. c:\francis\posto or c:\francis\posto\ (Windows) if the last char of StartupPath$ = "/" then --LINUX put char 1 to -2 of StartupPath$ into StartupPath$ end if --put char 1 to 3 of SourceDirectory$ into SourceDirectory$ --e.g. c:\ --REMOVED FOR LINUX --SourceDirectory$ can be: --"/" --"/media/floppy0/****************" (perhaps with some UCase) --"/media/cdrom0/****************" (perhaps with some UCase) put toLower(SourceDirectory$) into SourceDirectory$ if char 1 to 14 of SourceDirectory$ = "/media/floppy0" then put "/media/floppy0" into SourceDirectory$ if char 1 to 13 of SourceDirectory$ = "/media/cdrom0" then put "/media/cdrom0" into SourceDirectory$ if char 1 to 14 of SourceDirectory$ <> "/media/floppy0" and char 1 to 13 of SourceDirectory$ <> "/media/cdrom0" then put "/" into SourceDirectory$ --put word 1 to -1 of IndentSize into IndentSize put word 1 to -1 of TreeFontname$ into TreeFontname$ --put word 1 to -1 of TreeFontsize into TreeFontsize put word 1 to -1 of TreeFontbold$ into TreeFontbold$ put word 1 to -1 of TreeFontitalic$ into TreeFontitalic$ if SourceDirectory$ = "" then put "/" into SourceDirectory$ --LINUX if IndentSize = "" then put 4 into IndentSize if TreeFontname$ = "" then put "default" into TreeFontname$ if TreeFontsize = "" then put 14 into TreeFontsize if TreeFontbold$ = "" then put "no" into TreeFontbold$ if TreeFontitalic$ = "" then put "no" into TreeFontitalic$ put the toLower of TreeFontbold$ into TreeFontbold$ put the toLower of TreeFontitalic$ into TreeFontitalic$ set the textFont of field "List1" to TreeFontname$ set the textFont of field "List2" to TreeFontname$ set the textFont of button "Filters" to TreeFontname$ set the textFont of button "Cancel" to TreeFontname$ set the textFont of button "OK" to TreeFontname$ set the textSize of field "List1" to TreeFontsize set the textSize of field "List2" to TreeFontsize set the textSize of button "Filters" to TreeFontsize set the textSize of button "Cancel" to TreeFontsize set the textSize of button "OK" to TreeFontsize if TreeFontbold$ = "yes" then set the textStyle of field "List1" to "bold" set the textStyle of field "List2" to "bold" set the textStyle of button "Filters" to "bold" set the textStyle of button "Cancel" to "bold" set the textStyle of button "OK" to "bold" end if if TreeFontitalic$ = "yes" then set the textStyle of field "List1" to "italic" set the textStyle of field "List2" to "italic" set the textStyle of button "Filters" to "italic" set the textStyle of button "Cancel" to "italic" set the textStyle of button "OK" to "italic" end if if TreeFontbold$ = "yes" and TreeFontitalic$ = "yes" then set the textStyle of field "List1" to "bold,italic" set the textStyle of field "List2" to "bold,italic" set the textStyle of button "Filters" to "bold,italic" set the textStyle of button "Cancel" to "bold,italic" set the textStyle of button "OK" to "bold,italic" end if --SourceDirectory$ --put the first character of SourceDirectory$ into tempVar --NOT LINUX --SourceDirectory$ can be: --"/" --"/media/floppy0" --"/media/cdrom0" put SourceDirectory$ into tempVar -- tempVar can be: --"/" --"/media/floppy0" --"/media/cdrom0" put 255,255,255 into tempBackColour --******************************* put 0,0,215 into tempForeColour ----------------------------------------- global AdjustingWindow put 1 into AdjustingWindow ----------------------------------------- --Window left position (nnn or centre or center): --Window top position (nnn or centre or center): --Window width (nnn - min=320): --Window height (nnn - min=240): --Main background colour (e.g. grey or gray or 128,128,128 or #808080): --Main font colour (e.g. grey or gray or 128,128,128 or #808080): --Button background colour (e.g. grey or gray or 128,128,128 or #808080): --Button font colour (e.g. grey or gray or 128,128,128 or #808080): ----------------------------------------- --Example only: --put line 6 of field "IniParametersField" of card "Card4" of this stack into TreeFontitalic$ --e.g. "no" TreeFontitalic$ --put word 1 to -1 of TreeFontitalic$ into TreeFontitalic$ --put the toLower of TreeFontitalic$ into TreeFontitalic$ --if TreeFontitalic$ = "" then put "no" into TreeFontitalic$ ----------------------------------------- --Widget left position (nnn or centre or center): --Widget top position (nnn or centre or center): put line 7 of field "IniParametersField" of card "Card4" of this stack into WidgetLeftPosition put line 8 of field "IniParametersField" of card "Card4" of this stack into WidgetTopPosition put line 9 of field "IniParametersField" of card "Card4" of this stack into WidgetWidth put line 10 of field "IniParametersField" of card "Card4" of this stack into WidgetHeight Global OutputMode$ put line 11 of field "IniParametersField" of card "Card4" of this stack into OutputMode$ if the charToNum of the last char of WidgetLeftPosition is 13 then --LINUX only put char 1 to -2 of WidgetLeftPosition into WidgetLeftPosition end if if the charToNum of the last char of WidgetTopPosition is 13 then --LINUX only put char 1 to -2 of WidgetTopPosition into WidgetTopPosition end if if the charToNum of the last char of WidgetWidth is 13 then --LINUX only put char 1 to -2 of WidgetWidth into WidgetWidth end if if the charToNum of the last char of WidgetHeight is 13 then --LINUX only put char 1 to -2 of WidgetHeight into WidgetHeight end if if the charToNum of the last char of OutputMode$ is 13 then --LINUX only put char 1 to -2 of OutputMode$ into OutputMode$ end if Global PreviewPictureHeight put line 12 of field "IniParametersField" of card "Card4" of this stack into PreviewPictureHeight if the charToNum of the last char of PreviewPictureHeight is 13 then --LINUX only put char 1 to -2 of PreviewPictureHeight into PreviewPictureHeight end if put word 1 to -1 of WidgetLeftPosition into WidgetLeftPosition put word 1 to -1 of WidgetTopPosition into WidgetTopPosition put word 1 to -1 of WidgetWidth into WidgetWidth put word 1 to -1 of WidgetHeight into WidgetHeight put word 1 to -1 of OutputMode$ into OutputMode$ put word 1 to -1 of PreviewPictureHeight into PreviewPictureHeight put the toLower of WidgetLeftPosition into WidgetLeftPosition put the toLower of WidgetTopPosition into WidgetTopPosition put the toLower of WidgetWidth into WidgetWidth put the toLower of WidgetHeight into WidgetHeight put the toLower of OutputMode$ into OutputMode$ put the toLower of PreviewPictureHeight into PreviewPictureHeight if WidgetLeftPosition = "" then put "centre" into WidgetLeftPosition put "centre" into WidgetTopPosition end if if WidgetTopPosition = "" then put "centre" into WidgetLeftPosition put "centre" into WidgetTopPosition end if if WidgetLeftPosition = "center" then put "centre" into WidgetLeftPosition put "centre" into WidgetTopPosition end if if WidgetTopPosition = "center" then put "centre" into WidgetLeftPosition put "centre" into WidgetTopPosition end if if PreviewPictureHeight < 140 then put 140 into PreviewPictureHeight put WidgetHeight + PreviewPictureHeight into WidgetHeight --****************** if WidgetWidth < 320 then put 320 into WidgetWidth if WidgetHeight < 380 then put 380 into WidgetHeight --New minimum for picture chooser set the width of this stack to WidgetWidth set the height of this stack to WidgetHeight if WidgetLeftPosition <> "centre" and WidgetTopPosition <> "centre" then set the left of this stack to WidgetLeftPosition set the top of this stack to WidgetTopPosition end if if WidgetLeftPosition = "centre" and WidgetTopPosition = "centre" then Global ScreenWidth Global ScreenHeight --set the rect of this stack to the screenRect --put the width of this stack into ScreenWidth --put the height of this stack into ScreenHeight --The above should have already been done If WidgetWidth > ScreenWidth then put ScreenWidth into WidgetWidth If WidgetHeight > ScreenHeight then put ScreenHeight into WidgetHeight put (ScreenWidth - WidgetWidth) into HorizontalDifference put (ScreenHeight - WidgetHeight) into VerticalDifference put (HorizontalDifference / 2) into WidgetLeftMargin put (VerticalDifference / 2) into WidgetTopMargin set the left of this stack to WidgetLeftMargin set the top of this stack to WidgetTopMargin end if set the bottomright of button "OK" to (WidgetWidth - 15),(WidgetHeight - 15) set the top of button "Cancel" to the top of button "OK" set the right of button "Cancel" to (the left of button "OK" - 5) set the top of button "Filters" to the top of button "OK" set the width of button "Filters" to (the left of button "Cancel" - 20) set the left of button "Filters" to 15 put (WidgetWidth - 30) into HorizontalWidgetSpaceForLists put ((2 * HorizontalWidgetSpaceForLists) / 3) into List1Width set the width of field "List1" to List1Width set the width of field "List2" to (HorizontalWidgetSpaceForLists - the width of field "List1") set the left of field "List1" to 15 set the left of field "List2" to the right of field "List1" put (the top of button "Filters" - 10) - (the bottom of image "Root" + 10) - PreviewPictureHeight into theListHeight set the height of field "List1" to theListHeight set the height of field "List2" to theListHeight set the top of field "List1" to (the bottom of image "Root" + 10) set the top of field "List2" to (the bottom of image "Root" + 10) if OutputMode$ <> "hd" and OutputMode$ <> "clipboard" then put "hd" into OutputMode$ end if ----------------------------------------- ----------------------------------------- set the width of image "Preview" to (the right of field "List2" - the left of field "List1") set the height of image "Preview" to ((the top of button "Filters" - 10) - (the bottom of field "List1" + 10)) set the left of image "Preview" to the left of field "List1" set the top of image "Preview" to (the bottom of field "List1" + 10) set the minHeight of this stack to WidgetHeight ----------------------------------------- ----------------------------------------- --global AdjustingWindow put 0 into AdjustingWindow ----------------------------------------- -------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------- put URL "file:_picture_chooser_filters.ini" into field "Filters" of card "Card4" of this stack if line 1 of field "Filters" of card "Card4" of this stack is empty then put "*.* All files" into field "Filters" of card "Card4" of this stack end if put 0 into FilterCounter repeat for each line thisLine in field "Filters" of card "Card4" of this stack --LINUX only put (FilterCounter + 1) into FilterCounter if the charToNum of the last char of thisLine is 13 then put char 1 to -2 of thisLine into newLine$ else put thisLine into newLine$ end if put newLine$ into line FilterCounter of button "Filters" of card "Card1" of this stack --LINUX only end repeat -------------------------------------------------------------------------- --Global NumberOfDrives --For LINUX, this is between 1 and 3 --FOR LINUX: --Highlight the drive according to tempVar, which can be: --"/" --"/media/floppy0" --"/media/cdrom0" Global GotPathAlready if GotPathAlready <> 1 then remove_all_drivebox_highlights --***************************** Global WidgetFolder$ put the defaultfolder into WidgetFolder$ if the last char of WidgetFolder$ is "/" then put char 1 to -2 of WidgetFolder$ into WidgetFolder$ end if --***************************** If tempVar = "/" then call mouseDown of image "Root" end if If tempVar = "/media/cdrom0" then call mouseDown of image "CD" end if If tempVar = "/media/floppy0" then call mouseDown of image "Diskette" end if end if ---------------------------------------------------------------------------------------------------------------- put IndentSize into field "TextIndentSizeField" of card "Card3" ------------------------------------------------- put SourceDirectory$ into field "Text2" put SourceDirectory$ into InputDirectory$ put 1 into GotPathAlready put empty into field "List1" call mouseUp of button "GetFolderButton" of card "Card3" put field "ListExpandedField" of card "Card3" into field "List1" of this card end get_ini_parameters ---------------------------------------------------------------------------------------------- on iconifyStack Global AdjustingWindow if AdjustingWindow = 1 then pass iconifyStack Global ProgramWindowIsMinimized put 1 into ProgramWindowIsMinimized end iconifyStack ---------------------------------------------------------------------------------------------- on remove_all_drivebox_highlights Global AdjustingWindow if AdjustingWindow = 1 then pass remove_all_drivebox_highlights put image "Root_Blank" into image "Root" put image "CD_Blank" into image "CD" put image "Diskette_Blank" into image "Diskette" end remove_all_drivebox_highlights ---------------------------------------------------------------------------------------------- on error_reading_diskette Global AdjustingWindow if AdjustingWindow = 1 then pass error_reading_diskette put empty into field "List2" of card "Card1" --********************* if the sysError is 21 or the sysError is 1235 then Global DoingDiskError put 1 into DoingDiskError end if remove_all_drivebox_highlights end error_reading_diskette on get_startup_folder Global Init if Init = 1 then pass get_startup_folder Global SourceDirectory$ --e.g. c:\ (Windows) Global StartupPath$ --e.g. c:\francis\posto (Windows) if field "List1" of card "Card1" is empty then pass get_startup_folder put StartupPath$ into field "Text2" put StartupPath$ into SourceDirectory$ put SourceDirectory$ into InputDirectory$ put 1 into GotPathAlready put empty into field "List1" ----------------------------------------------------------------- Global IndentSize Global InputDirectory$ Global Counter put 0 into Counter repeat for 30 times put Counter + 1 into Counter if exists (field ("LabelBlockField" & Counter) of card "Card3") then delete field ("LabelBlockField" & Counter) of card "Card3" end if end repeat if the last character of InputDirectory$ is ":" then put (InputDirectory$ & "/") into InputDirectory$ --LINUX end if put InputDirectory$ into field "Text1Field" of card "Card3" --e.g. InputDirectory$: --d:\program files\howsoft\html slideshow (Windows) --Get the items of this string and put them into LabelBlockField0, LabelBlockField1 .... set the itemDelimiter to "/" --LINUX put 0 into Counter repeat for each item ThisItem in InputDirectory$ put Counter + 1 into Counter if the last item of InputDirectory$ is ThisItem then if exists (field ("LabelBlockField" & Counter) of card "Card3") is false then clone field "LabelBlockField0" of card "Card3" set the name of it to ("LabelBlockField" & Counter) end if put ThisItem into field ("LabelBlockField" & Counter) of card "Card3" exit repeat else if exists (field ("LabelBlockField" & Counter) of card "Card3") is false then clone field "LabelBlockField0" of card "Card3" set the name of it to ("LabelBlockField" & Counter) end if put ThisItem into field ("LabelBlockField" & Counter) of card "Card3" end if end repeat put empty into field "ListFilesField" of card "Card3" set the defaultFolder to InputDirectory$ ------------------------------------------------------------------------------ if the sysError is 21 or the sysError is 1235 then put "" into field "Text2" of card "Card1" put "" into SourceDirectory$ error_reading_diskette pass get_startup_folder end if --------------------------------------------------------------------------------- put the files into field "ListFilesField" of card "Card3" sort lines of field "ListFilesField" of card "Card3" put empty into field "ListSubfoldersField" of card "Card3" put the folders into field "ListSubfoldersField" of card "Card3" delete line 1 of field "ListSubfoldersField" of card "Card3" --***************************** sort lines of field "ListSubfoldersField" of card "Card3" --THIS PART IS TO MAKE LITERALLY THE PORTION OF THE LIST THAT NEEDS TO BE INCLUDED --AS A RESULT OF CLICKING ON A "+" LINE --The new items appearing in ListExpanded need to be tested one by one to see --whether they also contain folders. This determines whether they have "+" or Chr$(160) -- + Chr$(160) before them. if field "ListSubfoldersField" of card "Card3" is empty then put "no" into field "LabelLastBlockContainsFoldersField" of card "Card3" else put "yes" into field "LabelLastBlockContainsFoldersField" of card "Card3" end if put (Counter + 1) into field "LabelNumberOfBlocksField" of card "Card3" put empty into field "ListExpandedField" of card "Card3" --You have items in ListSubfolders such as: --d:\program files\adobe\acrobat 5.0 (Windows) --The number of blocks is in Counter + 1 or LabelNumberOfBlocks.Caption --The IndentSize is multiplied by the Sourcepath's number of blocks - 2, --or in other words, the max block number - 1 ---------------------------------------------------------------------------------------------- Global LHSIndentInBlankChars put ((Counter - 1) * IndentSize) into LHSIndentInBlankChars ---------------------------------------------------------------------------------------------- if LHSIndentInBlankChars < 0 then put 0 into LHSIndentInBlankChars end if put LHSIndentInBlankChars into field "LabelLHSIndentInBlankCharsField" of card "Card3" repeat for each line ThisLine in field "ListSubfoldersField" of card "Card3" put empty into field "TempField" of card "Card3" set the defaultFolder to InputDirectory$ & "/" & ThisLine put the folders into field "TempField" of card "Card3" delete line 1 of field "TempField" of card "Card3" --********************* sort lines of field "TempField" of card "Card3" if the number of lines in field "TempField" of card "Card3" is 0 then put (numToChar(160) & numToChar(160) & ThisLine) into ThisLine else put ("+" & ThisLine) into ThisLine end if if the number of characters in ThisLine > 0 then put ((field "ListExpandedField" of card "Card3") & return & ThisLine) into field "ListExpandedField" of card "Card3" end if end repeat ----------------------------------------------------------------- ----------------------------------------------------------------- put field "ListExpandedField" of card "Card3" into field "List1" of this card delete the first line of field "List1" of this card Global PathShowingInText2$ put field "Text2" of card "Card1" into PathShowingInText2$ set the defaultFolder to PathShowingInText2$ put the files into field "ListFilesField" of card "Card3" sort lines of field "ListFilesField" of card "Card3" call filter_out_files of field "List1" of card "Card1" put field "ListFilesField" of card "Card3" into field "List2" of card "Card1" set the label of this stack to field "Text2" of card "Card1" end get_startup_folder ------------------------------------------ on Position_Controls Global PreviewPictureHeight Global WidgetWidth Global WidgetHeight if PreviewPictureHeight < 140 then put 140 into PreviewPictureHeight put the width of this stack into WidgetWidth put the height of this stack into WidgetHeight if WidgetWidth < 320 then put 320 into WidgetWidth end if if WidgetHeight < 380 then put 380 into WidgetHeight --New minimum for picture chooser end if set the bottomright of button "OK" to (WidgetWidth - 15),(WidgetHeight - 15) set the top of button "Cancel" to the top of button "OK" set the right of button "Cancel" to (the left of button "OK" - 5) set the top of button "Filters" to the top of button "OK" set the width of button "Filters" to (the left of button "Cancel" - 20) set the left of button "Filters" to 15 put (WidgetWidth - 30) into HorizontalWidgetSpaceForLists put ((2 * HorizontalWidgetSpaceForLists) / 3) into List1Width set the width of field "List1" to List1Width set the width of field "List2" to (HorizontalWidgetSpaceForLists - the width of field "List1") set the left of field "List1" to 15 set the left of field "List2" to the right of field "List1" put (the top of button "Filters" - 10) - (the bottom of image "Root" + 10) - PreviewPictureHeight into theListHeight set the height of field "List1" to theListHeight set the height of field "List2" to theListHeight set the top of field "List1" to (the bottom of image "Root" + 10) set the top of field "List2" to (the bottom of image "Root" + 10) set the width of image "Preview" to (the right of field "List2" - the left of field "List1") set the height of image "Preview" to ((the top of button "Filters" - 10) - (the bottom of field "List1" + 10)) set the left of image "Preview" to the left of field "List1" set the top of image "Preview" to (the bottom of field "List1" + 10) ----------------------------------------- if the selectedline of field "List2" of card "Card1" is not zero then set the visible of image "Preview" to false end if end Position_Controls €VË@| PictureChooser@|ÿÿÿÿ UTahoma UArialUArialWArialWArialWArial UArialUArial$UArial$WArial U UArial U Helvetica UArial UArialcRevStandaloneSettings;scriptLibrariesInternet Geometry PrintingMacOSXfalse OSX,nameHDTreeMacOS,documentTypeUNIX,fileSelectortrueWindowsfalseMacOS,longVersionHDTree 1.0.0.0Windows,LegalCopyright.2006 howsoft.com All rights reserved worldwideWindows,CommentsAuthor: Robert J WarrenUNIX,pageSetuptrueOSX,documentTypeLinuxtrueWindows,documenticonFile;D:/Program Files/Revolution 2.6/Sample Icons/genericdoc.ico inclusionsselectOdtfalse answerDialogtrueSPARCfalseOSX,documentExtension SolIntelfalseWindows,FileDescription"Picture Chooser 1.0 for Windows XPOSX,longVersionHDTree 1.0.0.0 MacOSfatfalseUNIX,printerChoosertrueOSX,copyright.2005 howsoft.com All rights reserved worldwideMacOS,MinimumSize15000MacOS,versionnumber11MacOS,ReleaseFinalMacOS,versionnumber20MacOS,versionnumber30name_picture_chooserOSX,identifiercom.howsoft.com.hdtree MacOS,Region1rs6000falseHp9k700falseOSX,shortVersion1.0.0.0Windows,fileversion11Windows,fileversion21Windows,productversion11Windows,fileversion30Windows,productversion21Windows,fileversion40Windows,productversion30cursorstrueBsdfalse OSX,infoHDTree Version 1.0.0.0Windows,productversion40 MacOS68kfalseMacOS,dynamicMemorytrue askDialogtrueIrisfalseWindows,iconFile h_nearly_red_all_resolutions.icoOSX,signature????Windows,ProductNamePicture ChooserMacOS,PreferredSize15000UNIX,colorChoosertrue MacOSPPCfalseMacOS,creator???? SolSparcfalseWindows,companyname howsoft.comcREVGeometryCachestackID1084 cREVGeneralscriptChecksumDȌӯ ¢À妵Ûû bookmarks debugObjects handlerList½closeStackRequest preOpenStack resumeStack resizeStack show_drives get_ini_parameters iconifyStack remove_all_drivebox_highlights error_reading_diskette get_startup_folder Position_ControlsscriptSelectionchar 30135 to 30134 prevHandler preOpenStack tempScriptscriptÈì

on closeStackRequest

end closeStackRequest

on preOpenStack -- center the stack on the main screen

Global MyDir

put the defaultfolder into MyDir

show_drives

set the loc of this stack to the screenLoc

set the left of this stack to 0

set the top of this stack to 28

resizeStack

pass preOpenStack

end preOpenStack

on resumeStack

Global AdjustingWindow

if AdjustingWindow = 1 then pass resumeStack

Global Init

Global ScreenInfo

Global ScreenWidth

Global ScreenHeight

Global GapOnRight

-----------------------------------------------------------------------------------------

Global GotPathAlready

if GotPathAlready = 0 then

resizeStack --*******************

end if

end resumeStack

on resizeStack

Global AdjustingWindow

if AdjustingWindow = 1 then pass resizeStack

Global Init

Global ScreenInfo

Global ScreenWidth

Global ScreenHeight

Global GapOnRight

if Init = 1 then

Global WidgetWidth

Global WidgetHeight

Position_Controls

pass resizeStack --**************

end if

put the screenRect into ScreenInfo

----By default, the itemdelimeter is set to ","

put item 3 of ScreenInfo into ScreenWidth

put item 4 of ScreenInfo into ScreenHeight

set the left of image "Image1" to 0

set the top of image "Image1" to 0

--------------------------------------------------------------------------------------------

--Card1:

set the left of field "List1" of card "Card1" to 50

set the top of field "List1" of card "Card1" to 65

set the height of field "List1" of card "Card1" to ScreenHeight - 200

set the width of field "List1" of card "Card1" to 50 * (ScreenWidth / 100)

set the height of field "List2" of card "Card1" to the height of field "List1" of card "Card1"

set the top of field "List2" of card "Card1" to the top of field "List1" of card "Card1"

set the left of field "List2" of card "Card1" to the right of field "List1" of card "Card1"

put (ScreenWidth - the left of field "List2" of card "Card1") into GapOnRight

set the width of field "List2" of card "Card1" to GapOnRight - 50

show_drives

get_ini_parameters

call mouseDown of field "DriveField" of card "Card1"

delete line 1 of field "List1" of card "Card1"

---------------------------------------------------

Global SourceDirectory$ --e.g. c:\

Global StartupPath$ --e.g. c:\francis\posto

if the number of chars in StartupPath$ > the number of chars in SourceDirectory$ then

get_startup_folder

end if

---------------------------------------------------

Global InitialLeftOfPreviewBox

Global InitialTopOfPreviewBox

Global InitialWidthOfPreviewBox

Global InitialHeightOfPreviewBox

put the left of image "Preview" into InitialLeftOfPreviewBox

put the top of image "Preview" into InitialTopOfPreviewBox

put the width of image "Preview" into InitialWidthOfPreviewBox

put the height of image "Preview" into InitialHeightOfPreviewBox

put 1 into Init

end resizeStack

----------------------------------------------------------------------------------------------

on show_drives

Global AdjustingWindow

if AdjustingWindow = 1 then pass show_drives

Global DoingDiskError

if DoingDiskError = 1 then

put 0 into DoingDiskError

pass show_drives

end if

call mouseDown of field "DriveField" of card "Card1"

end show_drives

----------------------------------------------------------------------------------------------

on get_ini_parameters

Global AdjustingWindow

if AdjustingWindow = 1 then pass get_ini_parameters

Global SourceDirectory$

Global IndentSize

Global TreeFontname$

Global TreeFontsize

Global TreeFontbold$

Global TreeFontitalic$

Global NumberOfDrives

Global tempForeColour

Global tempBackColour

Global WidgetWidth

Global WidgetHeight

Global ProgramWindowIsMinimized

if ProgramWindowIsMinimized = 1 then

put 0 into ProgramWindowIsMinimized

pass get_ini_parameters

end if

set the left of image "Image1" of card "Card1" to 0

set the top of image "Image1" of card "Card1" to 0

put URL "file:_picture_chooser.ini" into field "IniParametersField" of card "Card4" of this stack

-----------------------------------------

--Startup drive (e.g. Windows only c:\):

--In Linux, startup folders can begin as follows:

--/

--/media/floppy0 or just "floppy" or "diskette"

--/media/cdrom0 or just "cd" or "cdrom"

--In the above optional startup drive specifications, you need to check for UCase, trailing slashes, etc.

--Specifications such as floppy/subfolder should not be permitted. These should be specified as /media/floppy0/subfolder

--Number of spaces for indents (e.g. 8):

--Fontname (e.g. Arial):

--Fontsize (e.g. 12):

--Bold (yes or no):

--Italic (yes or no):

--Window left position (nnn or centre or center):

--Window right position (nnn or centre or center):

--Window width (nnn - min=320):

--Window height (nnn - min=240):

-----------------------------------------

--go Card4 --TEMP ONLY

put line 1 of field "IniParametersField" of card "Card4" of this stack into SourceDirectory$ --e.g. "c:\" SourceDirectory$

if the charToNum of the last char of SourceDirectory$ is 13 then --LINUX only

put char 1 to -2 of SourceDirectory$ into SourceDirectory$

end if

--/

--/media/floppy0 or just "floppy" or "diskette"

--/media/cdrom0 or just "cd" or "cdrom"

if toLower(SourceDirectory$) = "floppy" then put "/media/floppy0" into SourceDirectory$

if toLower(SourceDirectory$) = "diskette" then put "/media/floppy0" into SourceDirectory$

if toLower(SourceDirectory$) = "cd" then put "/media/cdrom0" into SourceDirectory$

if toLower(SourceDirectory$) = "cdrom" then put "/media/cdrom0" into SourceDirectory$

if toLower(SourceDirectory$) = "/media/floppy0/" then put "/media/floppy0" into SourceDirectory$

if toLower(SourceDirectory$) = "/media/cdrom0/" then put "/media/cdrom0" into SourceDirectory$

put line 2 of field "IniParametersField" of card "Card4" of this stack into IndentSize --e.g. 8 IndentSize

put line 3 of field "IniParametersField" of card "Card4" of this stack into TreeFontname$ --e.g. "Arial" TreeFontname$

put line 4 of field "IniParametersField" of card "Card4" of this stack into TreeFontsize --e.g. 12 TreeFontsize

put line 5 of field "IniParametersField" of card "Card4" of this stack into TreeFontbold$ --e.g. "yes" TreeFontbold$

put line 6 of field "IniParametersField" of card "Card4" of this stack into TreeFontitalic$ --e.g. "no" TreeFontitalic$

if the charToNum of the last char of IndentSize is 13 then --LINUX only

put char 1 to -2 of IndentSize into IndentSize

end if

if the charToNum of the last char of TreeFontname$ is 13 then --LINUX only

put char 1 to -2 of TreeFontname$ into TreeFontname$

end if

if the charToNum of the last char of TreeFontsize is 13 then --LINUX only

put char 1 to -2 of TreeFontsize into TreeFontsize

end if

if the charToNum of the last char of TreeFontbold$ is 13 then --LINUX only

put char 1 to -2 of TreeFontbold$ into TreeFontbold$

end if

if the charToNum of the last char of TreeFontitalic$ is 13 then --LINUX only

put char 1 to -2 of TreeFontitalic$ into TreeFontitalic$

end if

put word 1 to -1 of SourceDirectory$ into SourceDirectory$

Global StartupPath$

put SourceDirectory$ into StartupPath$ --e.g. c:\francis\posto or c:\francis\posto\ (Windows)

if the last char of StartupPath$ = "/" then --LINUX

put char 1 to -2 of StartupPath$ into StartupPath$

end if

--put char 1 to 3 of SourceDirectory$ into SourceDirectory$ --e.g. c:\ --REMOVED FOR LINUX

--SourceDirectory$ can be:

--"/"

--"/media/floppy0/****************" (perhaps with some UCase)

--"/media/cdrom0/****************" (perhaps with some UCase)

put toLower(SourceDirectory$) into SourceDirectory$

if char 1 to 14 of SourceDirectory$ = "/media/floppy0" then put "/media/floppy0" into SourceDirectory$

if char 1 to 13 of SourceDirectory$ = "/media/cdrom0" then put "/media/cdrom0" into SourceDirectory$

if char 1 to 14 of SourceDirectory$ <> "/media/floppy0" and char 1 to 13 of SourceDirectory$ <> "/media/cdrom0" then put "/" into SourceDirectory$

--put word 1 to -1 of IndentSize into IndentSize

put word 1 to -1 of TreeFontname$ into TreeFontname$

--put word 1 to -1 of TreeFontsize into TreeFontsize

put word 1 to -1 of TreeFontbold$ into TreeFontbold$

put word 1 to -1 of TreeFontitalic$ into TreeFontitalic$

if SourceDirectory$ = "" then put "/" into SourceDirectory$ --LINUX

if IndentSize = "" then put 4 into IndentSize

if TreeFontname$ = "" then put "default" into TreeFontname$

if TreeFontsize = "" then put 14 into TreeFontsize

if TreeFontbold$ = "" then put "no" into TreeFontbold$

if TreeFontitalic$ = "" then put "no" into TreeFontitalic$

put the toLower of TreeFontbold$ into TreeFontbold$

put the toLower of TreeFontitalic$ into TreeFontitalic$

set the textFont of field "List1" to TreeFontname$

set the textFont of field "List2" to TreeFontname$

set the textFont of button "Filters" to TreeFontname$

set the textFont of button "Cancel" to TreeFontname$

set the textFont of button "OK" to TreeFontname$

set the textSize of field "List1" to TreeFontsize

set the textSize of field "List2" to TreeFontsize

set the textSize of button "Filters" to TreeFontsize

set the textSize of button "Cancel" to TreeFontsize

set the textSize of button "OK" to TreeFontsize

if TreeFontbold$ = "yes" then

set the textStyle of field "List1" to "bold"

set the textStyle of field "List2" to "bold"

set the textStyle of button "Filters" to "bold"

set the textStyle of button "Cancel" to "bold"

set the textStyle of button "OK" to "bold"

end if

if TreeFontitalic$ = "yes" then

set the textStyle of field "List1" to "italic"

set the textStyle of field "List2" to "italic"

set the textStyle of button "Filters" to "italic"

set the textStyle of button "Cancel" to "italic"

set the textStyle of button "OK" to "italic"

end if

if TreeFontbold$ = "yes" and TreeFontitalic$ = "yes" then

set the textStyle of field "List1" to "bold,italic"

set the textStyle of field "List2" to "bold,italic"

set the textStyle of button "Filters" to "bold,italic"

set the textStyle of button "Cancel" to "bold,italic"

set the textStyle of button "OK" to "bold,italic"

end if

--SourceDirectory$

--put the first character of SourceDirectory$ into tempVar --NOT LINUX

--SourceDirectory$ can be:

--"/"

--"/media/floppy0"

--"/media/cdrom0"

put SourceDirectory$ into tempVar

-- tempVar can be:

--"/"

--"/media/floppy0"

--"/media/cdrom0"

put 255,255,255 into tempBackColour --*******************************

put 0,0,215 into tempForeColour

-----------------------------------------

global AdjustingWindow

put 1 into AdjustingWindow

-----------------------------------------

--Window left position (nnn or centre or center):

--Window top position (nnn or centre or center):

--Window width (nnn - min=320):

--Window height (nnn - min=240):

--Main background colour (e.g. grey or gray or 128,128,128 or #808080):

--Main font colour (e.g. grey or gray or 128,128,128 or #808080):

--Button background colour (e.g. grey or gray or 128,128,128 or #808080):

--Button font colour (e.g. grey or gray or 128,128,128 or #808080):

-----------------------------------------

--Example only:

--put line 6 of field "IniParametersField" of card "Card4" of this stack into TreeFontitalic$ --e.g. "no" TreeFontitalic$

--put word 1 to -1 of TreeFontitalic$ into TreeFontitalic$

--put the toLower of TreeFontitalic$ into TreeFontitalic$

--if TreeFontitalic$ = "" then put "no" into TreeFontitalic$

-----------------------------------------

--Widget left position (nnn or centre or center):

--Widget top position (nnn or centre or center):

put line 7 of field "IniParametersField" of card "Card4" of this stack into WidgetLeftPosition

put line 8 of field "IniParametersField" of card "Card4" of this stack into WidgetTopPosition

put line 9 of field "IniParametersField" of card "Card4" of this stack into WidgetWidth

put line 10 of field "IniParametersField" of card "Card4" of this stack into WidgetHeight

Global OutputMode$

put line 11 of field "IniParametersField" of card "Card4" of this stack into OutputMode$

if the charToNum of the last char of WidgetLeftPosition is 13 then --LINUX only

put char 1 to -2 of WidgetLeftPosition into WidgetLeftPosition

end if

if the charToNum of the last char of WidgetTopPosition is 13 then --LINUX only

put char 1 to -2 of WidgetTopPosition into WidgetTopPosition

end if

if the charToNum of the last char of WidgetWidth is 13 then --LINUX only

put char 1 to -2 of WidgetWidth into WidgetWidth

end if

if the charToNum of the last char of WidgetHeight is 13 then --LINUX only

put char 1 to -2 of WidgetHeight into WidgetHeight

end if

if the charToNum of the last char of OutputMode$ is 13 then --LINUX only

put char 1 to -2 of OutputMode$ into OutputMode$

end if

Global PreviewPictureHeight

put line 12 of field "IniParametersField" of card "Card4" of this stack into PreviewPictureHeight

if the charToNum of the last char of PreviewPictureHeight is 13 then --LINUX only

put char 1 to -2 of PreviewPictureHeight into PreviewPictureHeight

end if

put word 1 to -1 of WidgetLeftPosition into WidgetLeftPosition

put word 1 to -1 of WidgetTopPosition into WidgetTopPosition

put word 1 to -1 of WidgetWidth into WidgetWidth

put word 1 to -1 of WidgetHeight into WidgetHeight

put word 1 to -1 of OutputMode$ into OutputMode$

put word 1 to -1 of PreviewPictureHeight into PreviewPictureHeight

put the toLower of WidgetLeftPosition into WidgetLeftPosition

put the toLower of WidgetTopPosition into WidgetTopPosition

put the toLower of WidgetWidth into WidgetWidth

put the toLower of WidgetHeight into WidgetHeight

put the toLower of OutputMode$ into OutputMode$

put the toLower of PreviewPictureHeight into PreviewPictureHeight

if WidgetLeftPosition = "" then

put "centre" into WidgetLeftPosition

put "centre" into WidgetTopPosition

end if

if WidgetTopPosition = "" then

put "centre" into WidgetLeftPosition

put "centre" into WidgetTopPosition

end if

if WidgetLeftPosition = "center" then

put "centre" into WidgetLeftPosition

put "centre" into WidgetTopPosition

end if

if WidgetTopPosition = "center" then

put "centre" into WidgetLeftPosition

put "centre" into WidgetTopPosition

end if

if PreviewPictureHeight < 140 then put 140 into PreviewPictureHeight

put WidgetHeight + PreviewPictureHeight into WidgetHeight --******************

if WidgetWidth < 320 then put 320 into WidgetWidth

if WidgetHeight < 380 then put 380 into WidgetHeight --New minimum for picture chooser

set the width of this stack to WidgetWidth

set the height of this stack to WidgetHeight

if WidgetLeftPosition <> "centre" and WidgetTopPosition <> "centre" then

set the left of this stack to WidgetLeftPosition

set the top of this stack to WidgetTopPosition

end if

if WidgetLeftPosition = "centre" and WidgetTopPosition = "centre" then

Global ScreenWidth

Global ScreenHeight

--set the rect of this stack to the screenRect

--put the width of this stack into ScreenWidth

--put the height of this stack into ScreenHeight

--The above should have already been done

If WidgetWidth > ScreenWidth then put ScreenWidth into WidgetWidth

If WidgetHeight > ScreenHeight then put ScreenHeight into WidgetHeight

put (ScreenWidth - WidgetWidth) into HorizontalDifference

put (ScreenHeight - WidgetHeight) into VerticalDifference

put (HorizontalDifference / 2) into WidgetLeftMargin

put (VerticalDifference / 2) into WidgetTopMargin

set the left of this stack to WidgetLeftMargin

set the top of this stack to WidgetTopMargin

end if

set the bottomright of button "OK" to (WidgetWidth - 15),(WidgetHeight - 15)

set the top of button "Cancel" to the top of button "OK"

set the right of button "Cancel" to (the left of button "OK" - 5)

set the top of button "Filters" to the top of button "OK"

set the width of button "Filters" to (the left of button "Cancel" - 20)

set the left of button "Filters" to 15

put (WidgetWidth - 30) into HorizontalWidgetSpaceForLists

put ((2 * HorizontalWidgetSpaceForLists) / 3) into List1Width

set the width of field "List1" to List1Width

set the width of field "List2" to (HorizontalWidgetSpaceForLists - the width of field "List1")

set the left of field "List1" to 15

set the left of field "List2" to the right of field "List1"

put (the top of button "Filters" - 10) - (the bottom of image "Root" + 10) - PreviewPictureHeight into theListHeight

set the height of field "List1" to theListHeight

set the height of field "List2" to theListHeight

set the top of field "List1" to (the bottom of image "Root" + 10)

set the top of field "List2" to (the bottom of image "Root" + 10)

if OutputMode$ <> "hd" and OutputMode$ <> "clipboard" then

put "hd" into OutputMode$

end if

-----------------------------------------

-----------------------------------------

set the width of image "Preview" to (the right of field "List2" - the left of field "List1")

set the height of image "Preview" to ((the top of button "Filters" - 10) - (the bottom of field "List1" + 10))

set the left of image "Preview" to the left of field "List1"

set the top of image "Preview" to (the bottom of field "List1" + 10)

set the minHeight of this stack to WidgetHeight

-----------------------------------------

-----------------------------------------

--global AdjustingWindow

put 0 into AdjustingWindow

-----------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

put URL "file:_picture_chooser_filters.ini" into field "Filters" of card "Card4" of this stack

if line 1 of field "Filters" of card "Card4" of this stack is empty then

put "*.* All files" into field "Filters" of card "Card4" of this stack

end if

put 0 into FilterCounter

repeat for each line thisLine in field "Filters" of card "Card4" of this stack --LINUX only

put (FilterCounter + 1) into FilterCounter

if the charToNum of the last char of thisLine is 13 then

put char 1 to -2 of thisLine into newLine$

else

put thisLine into newLine$

end if

put newLine$ into line FilterCounter of button "Filters" of card "Card1" of this stack --LINUX only

end repeat

--------------------------------------------------------------------------

--Global NumberOfDrives --For LINUX, this is between 1 and 3

--FOR LINUX:

--Highlight the drive according to tempVar, which can be:

--"/"

--"/media/floppy0"

--"/media/cdrom0"

Global GotPathAlready

if GotPathAlready <> 1 then

remove_all_drivebox_highlights

--*****************************

Global WidgetFolder$

put the defaultfolder into WidgetFolder$

if the last char of WidgetFolder$ is "/" then

put char 1 to -2 of WidgetFolder$ into WidgetFolder$

end if

--*****************************

If tempVar = "/" then

call mouseDown of image "Root"

end if

If tempVar = "/media/cdrom0" then

call mouseDown of image "CD"

end if

If tempVar = "/media/floppy0" then

call mouseDown of image "Diskette"

end if

end if

----------------------------------------------------------------------------------------------------------------

put IndentSize into field "TextIndentSizeField" of card "Card3"

-------------------------------------------------

put SourceDirectory$ into field "Text2"

put SourceDirectory$ into InputDirectory$

put 1 into GotPathAlready

put empty into field "List1"

call mouseUp of button "GetFolderButton" of card "Card3"

put field "ListExpandedField" of card "Card3" into field "List1" of this card

end get_ini_parameters

----------------------------------------------------------------------------------------------

on iconifyStack

Global AdjustingWindow

if AdjustingWindow = 1 then pass iconifyStack

Global ProgramWindowIsMinimized

put 1 into ProgramWindowIsMinimized

end iconifyStack

----------------------------------------------------------------------------------------------

on remove_all_drivebox_highlights

Global AdjustingWindow

if AdjustingWindow = 1 then pass remove_all_drivebox_highlights

put image "Root_Blank" into image "Root"

put image "CD_Blank" into image "CD"

put image "Diskette_Blank" into image "Diskette"

end remove_all_drivebox_highlights

----------------------------------------------------------------------------------------------

on error_reading_diskette

Global AdjustingWindow

if AdjustingWindow = 1 then pass error_reading_diskette

put empty into field "List2" of card "Card1" --*********************

if the sysError is 21 or the sysError is 1235 then

Global DoingDiskError

put 1 into DoingDiskError

end if

remove_all_drivebox_highlights

end error_reading_diskette

on get_startup_folder

Global Init

if Init = 1 then pass get_startup_folder

Global SourceDirectory$ --e.g. c:\ (Windows)

Global StartupPath$ --e.g. c:\francis\posto (Windows)

if field "List1" of card "Card1" is empty then pass get_startup_folder

put StartupPath$ into field "Text2"

put StartupPath$ into SourceDirectory$

put SourceDirectory$ into InputDirectory$

put 1 into GotPathAlready

put empty into field "List1"

-----------------------------------------------------------------

Global IndentSize

Global InputDirectory$

Global Counter

put 0 into Counter

repeat for 30 times

put Counter + 1 into Counter

if exists (field ("LabelBlockField" & Counter) of card "Card3") then

delete field ("LabelBlockField" & Counter) of card "Card3"

end if

end repeat

if the last character of InputDirectory$ is ":" then

put (InputDirectory$ & "/") into InputDirectory$ --LINUX

end if

put InputDirectory$ into field "Text1Field" of card "Card3"

--e.g. InputDirectory$:

--d:\program files\howsoft\html slideshow (Windows)

--Get the items of this string and put them into LabelBlockField0, LabelBlockField1 ....

set the itemDelimiter to "/" --LINUX

put 0 into Counter

repeat for each item ThisItem in InputDirectory$

put Counter + 1 into Counter

if the last item of InputDirectory$ is ThisItem then

if exists (field ("LabelBlockField" & Counter) of card "Card3") is false then

clone field "LabelBlockField0" of card "Card3"

set the name of it to ("LabelBlockField" & Counter)

end if

put ThisItem into field ("LabelBlockField" & Counter) of card "Card3"

exit repeat

else

if exists (field ("LabelBlockField" & Counter) of card "Card3") is false then

clone field "LabelBlockField0" of card "Card3"

set the name of it to ("LabelBlockField" & Counter)

end if

put ThisItem into field ("LabelBlockField" & Counter) of card "Card3"

end if

end repeat

put empty into field "ListFilesField" of card "Card3"

set the defaultFolder to InputDirectory$

------------------------------------------------------------------------------

if the sysError is 21 or the sysError is 1235 then

put "" into field "Text2" of card "Card1"

put "" into SourceDirectory$

error_reading_diskette

pass get_startup_folder

end if

---------------------------------------------------------------------------------

put the files into field "ListFilesField" of card "Card3"

sort lines of field "ListFilesField" of card "Card3"

put empty into field "ListSubfoldersField" of card "Card3"

put the folders into field "ListSubfoldersField" of card "Card3"

delete line 1 of field "ListSubfoldersField" of card "Card3" --*****************************

sort lines of field "ListSubfoldersField" of card "Card3"

--THIS PART IS TO MAKE LITERALLY THE PORTION OF THE LIST THAT NEEDS TO BE INCLUDED

--AS A RESULT OF CLICKING ON A "+" LINE

--The new items appearing in ListExpanded need to be tested one by one to see

--whether they also contain folders. This determines whether they have "+" or Chr$(160)

-- + Chr$(160) before them.

if field "ListSubfoldersField" of card "Card3" is empty then

put "no" into field "LabelLastBlockContainsFoldersField" of card "Card3"

else

put "yes" into field "LabelLastBlockContainsFoldersField" of card "Card3"

end if

put (Counter + 1) into field "LabelNumberOfBlocksField" of card "Card3"

put empty into field "ListExpandedField" of card "Card3"

--You have items in ListSubfolders such as:

--d:\program files\adobe\acrobat 5.0 (Windows)

--The number of blocks is in Counter + 1 or LabelNumberOfBlocks.Caption

--The IndentSize is multiplied by the Sourcepath's number of blocks - 2,

--or in other words, the max block number - 1

----------------------------------------------------------------------------------------------

Global LHSIndentInBlankChars

put ((Counter - 1) * IndentSize) into LHSIndentInBlankChars

----------------------------------------------------------------------------------------------

if LHSIndentInBlankChars < 0 then

put 0 into LHSIndentInBlankChars

end if

put LHSIndentInBlankChars into field "LabelLHSIndentInBlankCharsField" of card "Card3"

repeat for each line ThisLine in field "ListSubfoldersField" of card "Card3"

put empty into field "TempField" of card "Card3"

set the defaultFolder to InputDirectory$ & "/" & ThisLine

put the folders into field "TempField" of card "Card3"

delete line 1 of field "TempField" of card "Card3" --*********************

sort lines of field "TempField" of card "Card3"

if the number of lines in field "TempField" of card "Card3" is 0 then

put (numToChar(160) & numToChar(160) & ThisLine) into ThisLine

else

put ("+" & ThisLine) into ThisLine

end if

if the number of characters in ThisLine > 0 then

put ((field "ListExpandedField" of card "Card3") & return & ThisLine) into field "ListExpandedField" of card "Card3"

end if

end repeat

-----------------------------------------------------------------

-----------------------------------------------------------------

put field "ListExpandedField" of card "Card3" into field "List1" of this card

delete the first line of field "List1" of this card

Global PathShowingInText2$

put field "Text2" of card "Card1" into PathShowingInText2$

set the defaultFolder to PathShowingInText2$

put the files into field "ListFilesField" of card "Card3"

sort lines of field "ListFilesField" of card "Card3"

call filter_out_files of field "List1" of card "Card1"

put field "ListFilesField" of card "Card3" into field "List2" of card "Card1"

set the label of this stack to field "Text2" of card "Card1"

end get_startup_folder

------------------------------------------

on Position_Controls

Global PreviewPictureHeight

Global WidgetWidth

Global WidgetHeight

if PreviewPictureHeight < 140 then put 140 into PreviewPictureHeight

put the width of this stack into WidgetWidth

put the height of this stack into WidgetHeight

if WidgetWidth < 320 then

put 320 into WidgetWidth

end if

if WidgetHeight < 380 then

put 380 into WidgetHeight --New minimum for picture chooser

end if

set the bottomright of button "OK" to (WidgetWidth - 15),(WidgetHeight - 15)

set the top of button "Cancel" to the top of button "OK"

set the right of button "Cancel" to (the left of button "OK" - 5)

set the top of button "Filters" to the top of button "OK"

set the width of button "Filters" to (the left of button "Cancel" - 20)

set the left of button "Filters" to 15

put (WidgetWidth - 30) into HorizontalWidgetSpaceForLists

put ((2 * HorizontalWidgetSpaceForLists) / 3) into List1Width

set the width of field "List1" to List1Width

set the width of field "List2" to (HorizontalWidgetSpaceForLists - the width of field "List1")

set the left of field "List1" to 15

set the left of field "List2" to the right of field "List1"

put (the top of button "Filters" - 10) - (the bottom of image "Root" + 10) - PreviewPictureHeight into theListHeight

set the height of field "List1" to theListHeight

set the height of field "List2" to theListHeight

set the top of field "List1" to (the bottom of image "Root" + 10)

set the top of field "List2" to (the bottom of image "Root" + 10)

set the width of image "Preview" to (the right of field "List2" - the left of field "List1")

set the height of image "Preview" to ((the top of button "Filters" - 10) - (the bottom of field "List1" + 10))

set the left of image "Preview" to the left of field "List1"

set the top of image "Preview" to (the bottom of field "List1" + 10)

-----------------------------------------

if the selectedline of field "List2" of card "Card1" is not zero then

set the visible of image "Preview" to false

end if

end Position_Controls

êCard1 P ²on openCard hide this stack show this stack -------------------------------------------------------------------------------------- --Private Sub Form_Load() --On Error Resume Next --'Global SourceDirectory$ --'Global IndentSize --'Global TreeFontname$ --'Global TreeFontsize --'Global TreeFontbold --'Global TreeFontitalic --Open App.Path + "\_HDtree.ini" For Input As #1 --Input #1, SourceDirectory$ --Input #1, IndentSize --Input #1, TreeFontname$ --Input #1, TreeFontsize --Input #1, TreeFontbold --Input #1, TreeFontitalic --Input #1, ScrollSmallAndLargeChange --Close #1 --If SourceDirectory$ = "" Then SourceDirectory$ = Form1.LabelSourceDirectory.Caption --If IndentSize = 0 Then IndentSize = Val(Form1.LabelIndentSize.Caption) --If TreeFontname$ = "" Then TreeFontname$ = Form1.LabelFontname.Caption --If TreeFontsize = 0 Then TreeFontsize = Val(Form1.LabelFontsize.Caption) --If Err <> 0 Then --If Trim$(LCase$(Form1.LabelFontbold.Caption)) = "yes" Then --TreeFontbold = -1 --Else --TreeFontbold = 0 --End If --End If --If Err <> 0 Then --If Trim$(LCase$(Form1.LabelFontitalic.Caption)) = "yes" Then --TreeFontitalic = -1 --Else --TreeFontitalic = 0 --End If --End If --If ScrollSmallAndLargeChange = 0 Then ScrollSmallAndLargeChange = 120 --Err = 0 --'Global IndentSize --Form3.TextIndentSize.Text = CStr(IndentSize) --Form1.List1.FontName = TreeFontname$ --Form1.List1.FontSize = TreeFontsize --Form1.List1.FontBold = TreeFontbold --Form1.List1.FontItalic = TreeFontitalic --Form1.List2.FontName = TreeFontname$ --Form1.Text2.FontName = TreeFontname$ --Form1.List2.FontSize = TreeFontsize --Form1.List2.FontBold = TreeFontbold --Form1.List2.FontItalic = TreeFontitalic --Form1.Text1.Text = SourceDirectory$ --Form3.Text1.Text = SourceDirectory$ --Form1.Text2.Text = SourceDirectory$ --Form1.VScroll1.SmallChange = ScrollSmallAndLargeChange --Form1.VScroll1.LargeChange = ScrollSmallAndLargeChange --'Global GotPathAlready --GotPathAlready = 1 --'Global InputDirectory$ --InputDirectory$ = SourceDirectory$ --Call Form3.Command1_Click --'Form3.Show 'for removal --'ListExpanded --For n = 0 To Form3.ListExpanded.ListCount - 1 --ThisItem$ = Form3.ListExpanded.List(n) --Form1.List1.AddItem ThisItem$ --Next n --'Form1.VScroll1.Min = -1 --'Form1.VScroll1.Max = ((Form1.List1.Height - Form1.VScroll1.Height + 270) / 15) + 10 --Adjust_Scroll --Set_Up_Drive_Icons --End Sub end openCard €@|cREVGeometryCacheIDs11397840112741076113978805468910791139783554152107411188921232741013113978781274010771131039307932104911397883024601082113978368186910751136678675556107311362221471671065113624359839510661136244250907106811397881244331080113629762758610691139788241472108111187938454871006113978791581710781118863130578100811187937815481004cREVGeometrycachetotal19order  cREVGeneralscriptChecksum¹Ãúúœ«Í']‹¸¤Ó®¬" bookmarks handlerListopenCardscriptSelection char 15 to 14 prevHandleropenCard tempScriptscript

on openCard

hide this stack

show this stack

--------------------------------------------------------------------------------------

--Private Sub Form_Load()

--On Error Resume Next

--'Global SourceDirectory$

--'Global IndentSize

--'Global TreeFontname$

--'Global TreeFontsize

--'Global TreeFontbold

--'Global TreeFontitalic

--Open App.Path + "\_HDtree.ini" For Input As #1

--Input #1, SourceDirectory$

--Input #1, IndentSize

--Input #1, TreeFontname$

--Input #1, TreeFontsize

--Input #1, TreeFontbold

--Input #1, TreeFontitalic

--Input #1, ScrollSmallAndLargeChange

--Close #1

--If SourceDirectory$ = "" Then SourceDirectory$ = Form1.LabelSourceDirectory.Caption

--If IndentSize = 0 Then IndentSize = Val(Form1.LabelIndentSize.Caption)

--If TreeFontname$ = "" Then TreeFontname$ = Form1.LabelFontname.Caption

--If TreeFontsize = 0 Then TreeFontsize = Val(Form1.LabelFontsize.Caption)

--If Err <> 0 Then

--If Trim$(LCase$(Form1.LabelFontbold.Caption)) = "yes" Then

--TreeFontbold = -1

--Else

--TreeFontbold = 0

--End If

--End If

--If Err <> 0 Then

--If Trim$(LCase$(Form1.LabelFontitalic.Caption)) = "yes" Then

--TreeFontitalic = -1

--Else

--TreeFontitalic = 0

--End If

--End If

--If ScrollSmallAndLargeChange = 0 Then ScrollSmallAndLargeChange = 120

--Err = 0

--'Global IndentSize

--Form3.TextIndentSize.Text = CStr(IndentSize)

--Form1.List1.FontName = TreeFontname$

--Form1.List1.FontSize = TreeFontsize

--Form1.List1.FontBold = TreeFontbold

--Form1.List1.FontItalic = TreeFontitalic

--Form1.List2.FontName = TreeFontname$

--Form1.Text2.FontName = TreeFontname$

--Form1.List2.FontSize = TreeFontsize

--Form1.List2.FontBold = TreeFontbold

--Form1.List2.FontItalic = TreeFontitalic

--Form1.Text1.Text = SourceDirectory$

--Form3.Text1.Text = SourceDirectory$

--Form1.Text2.Text = SourceDirectory$

--Form1.VScroll1.SmallChange = ScrollSmallAndLargeChange

--Form1.VScroll1.LargeChange = ScrollSmallAndLargeChange

--'Global GotPathAlready

--GotPathAlready = 1

--'Global InputDirectory$

--InputDirectory$ = SourceDirectory$

--Call Form3.Command1_Click

--'Form3.Show 'for removal

--'ListExpanded

--For n = 0 To Form3.ListExpanded.ListCount - 1

--ThisItem$ = Form3.ListExpanded.List(n)

--Form1.List1.AddItem ThisItem$

--Next n

--'Form1.VScroll1.Min = -1

--'Form1.VScroll1.Max = ((Form1.List1.Height - Form1.VScroll1.Height + 270) / 15) + 10

--Adjust_Scroll

--Set_Up_Drive_Icons

--End Sub

end openCard

-ìî)*,1õ23456789:ðñCard2 @€@|cREVGeometryCacheIDs 113397732716610561133977215380105511339776122351059113403951982410601133977086796105411339769820031053113397689457910521133977427446105711339775128471058 cREVGeneral bookmarks handlerList tempScript prevHandlerscriptcREVGeometryCacheordertotal9 !"#$;òCard3 @€@|cREVGeometryCacheIDs1119190048195103511191899311591031111919081676810441119189985468103311191894554521028111930715073110471119190793357104211363111912291070111918977794910301119190612056104011191908068271043111919058891110391119190165934103711191895386061029113640060420710721119190535316103811191907845871041cREVGeometryCacheordertotal17   .0óCard4 @€cREVGeometryCacheIDs113621469416010631136215150469106411191210939711015cREVGeometryCacheordertotal3÷'( ìList1Å)8™"on rawKeyDown end rawKeyDown on mouseDown put empty into image "Preview" of card "Card1" set the visible of image "Preview" of card "Card1" to false disable button "OK" of card "Card1" Global DoingSelect If DoingSelect = 1 Then pass mouseDown --''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' --'When the operator clicks on a line with "+" WITH SOME INDENT --'1) Save the tree up to and including the clicked line in traceback.txt --'2) Set the SourceDirectory$ (see original program) and run the traceback module. --'3) Note the HDpath (to the line clicked) --'4) Input the ENTIRE HDpath from above to the Expand Folder module --'5) This module produces a new segment (with the expanded folders) to be included --'in the tree immediately after the line with "+" that was clicked. --'6) Put the traceback.txt data from 1), the new segment data from 5) and the rest --'of the treefile after the "+" line that was clicked all together to form a new treefile. --''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' --'When the operator clicks on a line with "+" WITH NO INDENT --'a) Deduce the path to the line clicked from the line clicked itself --'b) Continue for 4) above --'c) When copying back the data in step 6), a single indent will be needed in the --'new segment --'************************************************************************************** Global LineNumberClicked put the second word of the mouseline into LineNumberClicked Global ItemClicked$ put the the value of the clickLine into ItemClicked$ if char 1 of ItemClicked$ <> " " Then call LineClickedWithNoIndent pass mouseDown end if if char 1 of ItemClicked$ = " " then call LineClickedWithIndent pass mouseDown end if pass mouseDown end mouseDown ----------------------------------------------------------------------------------- on LineClickedWithNoIndent Global ItemClicked$ if char 1 of ItemClicked$ = "+" Then call LineClickedWithNoIndentButPlus --******************************************************************** if the charToNum of the last char of field "List1" = 10 then delete the last char of field "List1" --************************* Global LineNumberClicked select line LineNumberClicked of field "List1" end if --******************************************************************** pass LineClickedWithNoIndent end if if char 1 of ItemClicked$ = "-" Then call LineClickedWithNoIndentButMinus --******************************************************************** if the charToNum of the last char of field "List1" = 10 then Global LineNumberClicked delete the last char of field "List1" --************************* select line LineNumberClicked of field "List1" end if --******************************************************************** pass LineClickedWithNoIndent end if if char 1 of ItemClicked$ = numtochar(160) then call LineClickedWithNoIndentButChr160 --******************************************************************** if the charToNum of the last char of field "List1" = 10 then Global LineNumberClicked delete the last char of field "List1" --************************* select line LineNumberClicked of field "List1" end if --******************************************************************** pass LineClickedWithNoIndent end if end LineClickedWithNoIndent ----------------------------------------------------------------------------------- on LineClickedWithNoIndentButPlus Global PathBlock$ Global SourceDirectory$ Global ItemClicked$ Global HDPathToExpand$ put char 2 to -1 of ItemClicked$ into PathBlock$ If char -1 of SourceDirectory$ = "/" Then --LINUX put SourceDirectory$ & PathBlock$ into HDPathToExpand$ Else put SourceDirectory$ & "/" & PathBlock$ into HDPathToExpand$ --LINUX End If Global InputDirectory$ put HDPathToExpand$ into field "Text1Field" of card "card3" put word 1 to -1 of field "Text1Field" of card "card3" into InputDirectory$ Global GotPathAlready put 1 into GotPathAlready call mouseUp of button "GetFolderButton" of card "card3" --'The new segment is now in Form3.ListExpanded --'It will need indents added to it. put empty into field "List3" Global LineNumberClicked put 0 into n repeat (LineNumberClicked -1) times put n + 1 into n put line n of field "List1" into ThisItem$ put field "List3" & ThisItem$ & return into field "List3" end repeat Global PathBlock$ put "--" & PathBlock$ into NewItemClicked$ put field "List3" & NewItemClicked$ into field "List3" Global IndentSize put 0 into n repeat until n = the number of lines of field "ListExpandedField" of card "Card3" put n + 1 into n put line n of field "ListExpandedField" of card "Card3" into ThisItem$ put 0 into c if IndentSize > 0 then repeat until c = IndentSize put c + 1 into c put space & ThisItem$ into ThisItem$ end repeat end if put field "List3" & ThisItem$ & return into field "List3" end repeat --Global LineNumberClicked If LineNumberClicked < the number of lines of field "List1" then put LineNumberClicked into n repeat until n = the number of lines of field "List1" put n + 1 into n put line n of field "List1" into ThisItem$ put field "List3" & ThisItem$ & return into field "List3" end repeat --NewTreeNowMounted: end if put empty into field "List1" put 0 into n repeat until n = the number of lines of field "List3" put n + 1 into n put line n of field "List3" into ThisItem$ put field "List1" & ThisItem$ & return into field "List1" end repeat Global LineNumberClicked select line LineNumberClicked of field "List1" put HDPathToExpand$ into field "Text2" set the label of this stack to field "Text2" of card "Card1" put empty into field "List2" ------------------------------------------ Global HDPathToExpand$ set the defaultFolder to HDPathToExpand$ put the files into field "ListFilesField" of card "Card3" sort lines of field "ListFilesField" of card "Card3" call filter_out_files ----------------------------------------- if the number of lines of field "ListFilesField" of card "Card3" = 0 then pass LineClickedWithNoIndentButPlus end if put field "ListFilesField" of card "Card3" into field "List2" of card "Card1" --FilesAllListed: Global LineNumberSelectedInList1 put LineNumberClicked into LineNumberSelectedInList1 end LineClickedWithNoIndentButPlus ----------------------------------------------------------------------------------- on LineClickedWithNoIndentButMinus --'e.g. --'--Program Files <--------------------YOU CLICKED HERE --' +Accessories --' +Adaptec --' --Adobe --' --Acrobat 5.0 --' +Help --' --Reader --'   ActiveX --'   Browser --'   JavaScripts --'   Legal --'   Optional --' --plug_ins --'   InterTrust --'   Movie --' +WEBBUY --'+rebol --'The task here is simply to remove everything following the line clicked up to (but --'not including) +rebol and to change the line clicked from minus to plus: --'+Program Files <--------------------YOU CLICKED HERE --'Then, you need to show what files (if any) are present in the clicked line folder --'The path to the directory is simply Global SourceDirectory$ + "\Program Files" --'''''''''''''''''''''''''''''''''''''''''''''' --'e.g. --'--Program Files <--------------------YOU CLICKED HERE Global LineNumberClicked put the second word of the mouseline into LineNumberClicked Global ItemClicked$ put the value of the clickLine into ItemClicked$ Global SourceDirectory$ put char 3 to -1 of ItemClicked$ into EndBlock$ put SourceDirectory$ into DriveEtcBit$ If char -1 of DriveEtcBit$ = "/" Then --LINUX put char 1 to -2 of DriveEtcBit$ into DriveEtcBit$ end if put (DriveEtcBit$ & "/" & EndBlock$) into PathToLineClicked$ --LINUX put PathToLineClicked$ into field "Text2" of card "Card1" set the label of this stack to field "Text2" of card "Card1" --'Show files straight away: put empty into field "List2" put empty into field "ListFilesField" of card "Card3" set the defaultFolder to PathToLineClicked$ put the files into field "ListFilesField" of card "Card3" call filter_out_files ------------------------------- sort lines of field "ListFilesField" of card "Card3" if field "ListFilesField" of card "Card3" is not empty then put field "ListFilesField" of card "Card3" into field "List2" of card "Card1" end if --ShownAllFilesNIB: --'''''''''''''''''''''''''''' --'--Program Files <--------------------YOU CLICKED HERE --' +Accessories --' +Adaptec --' --Adobe --' --Acrobat 5.0 --' +Help --' --Reader --'   ActiveX --'   Browser --'   JavaScripts --'   Legal --'   Optional --' --plug_ins --'   InterTrust --'   Movie --' +WEBBUY --'+rebol --'The task here is simply to remove everything following the line clicked up to (but --'not including) +rebol and to change the line clicked from minus to plus: put empty into field "List3" of card "Card1" put 0 into n if LineNumberClicked > 0 then repeat for (LineNumberClicked -1) times put (n + 1) into n put line n of field "List1" into LineToAdd put (field "List3" & return & LineToAdd) into field "List3" end repeat delete line 1 of field "List3" --************* end if --CopiedUpToLineBeforeLineClickedNIB: --'Change the line clicked from minus to plus and copy it: put ("+" & EndBlock$) into NewLineClicked$ put (field "List3" & return & NewLineClicked$) into field "List3" --'Remove all following lines until you find another line with no blanks on the LHS --'OR EOF: put LineNumberClicked into ThisLineNumber repeat forever put (ThisLineNumber + 1) into ThisLineNumber If the first char of line ThisLineNumber of field "List1" <> space then exit repeat if ThisLineNumber = the number of lines in field "List1" then exit repeat end repeat if ThisLineNumber < the number of lines in field "List1" then put (ThisLineNumber - 1) into n put (field "List3" & return) into field "List3" repeat forever put (n + 1) into n put line n of field "List1" into ThisItem$ put (field "List3" & ThisItem$ & return) into field "List3" if n = the number of lines in field "List1" then exit repeat end repeat end if --CopiedRestOfFileNIB: --'Copy from List3 back to List1: -------------------------------------------------- if LineNumberClicked = 1 then delete line 1 of field "List3" --************************************* -------------------------------------------------- put field "List3" into field "List1" select line LineNumberClicked of field "List1" Global LineNumberSelectedInList1 put LineNumberClicked into LineNumberSelectedInList1 end LineClickedWithNoIndentButMinus ----------------------------------------------------------------------------------- on LineClickedWithNoIndentButChr160 --'e.g. --'+Program Files --'+rebol --'+shit --'  shit2 <-----------YOU CLICKED HERE --'+VB1 --'+VisualWx --'+WINDOWS --'+WindowsME.BAK --'--WINICON --'   BIN --' +IPL --'The only action here is to show what files may or may not be present in shit2 --'The path to the directory is simply Global SourceDirectory$ + "\shit2" --'''''''''''''''''''''''''''''''''''''''''''''' --'  shit2 <-----------YOU CLICKED HERE Global LineNumberClicked put the second word of the mouseline into LineNumberClicked Global ItemClicked$ put the the value of the clickLine into ItemClicked$ Global SourceDirectory$ put char 3 to -1 of ItemClicked$ into EndBlock$ put SourceDirectory$ into DriveEtcBit$ If char -1 of DriveEtcBit$ = "/" Then --LINUX put char 1 to -2 of DriveEtcBit$ into DriveEtcBit$ end if put (DriveEtcBit$ & "/" & EndBlock$) into PathToLineClicked$ --LINUX put PathToLineClicked$ into field "Text2" of card "Card1" set the label of this stack to field "Text2" of card "Card1" --'Show files straight away: put empty into field "List2" put empty into field "ListFilesField" of card "Card3" set the defaultFolder to PathToLineClicked$ put the files into field "ListFilesField" of card "Card3" call filter_out_files sort lines of field "ListFilesField" of card "Card3" if field "ListFilesField" of card "Card3" is not empty then put field "ListFilesField" of card "Card3" into field "List2" of card "Card1" end if --ShownAllFilesChr160: select line LineNumberClicked of field "List1" Global LineNumberSelectedInList1 put LineNumberClicked into LineNumberSelectedInList1 end LineClickedWithNoIndentButChr160 --------------------------------------------------------------------------------------------------------------- on LineClickedWithIndent Global LineNumberClicked Global ItemClicked$ put the second word of the mouseline into LineNumberClicked --********** put the the value of the clickLine into ItemClicked$ --********** put ItemClicked$ into TestString$ put word 1 to -1 of TestString$ into TestString$ if the first char of TestString$ is "+" then call LineClickedWithIndentAndPlus if the first char of TestString$ is "-" then call LineClickedWithIndentAndMinus if the charToNum of the first char of TestString$ is 160 then call LineClickedWithIndentAndChr160 --******************************************************************** if the charToNum of the last char of field "List1" = 10 then Global LineNumberClicked delete the last char of field "List1" --************************* select line LineNumberClicked of field "List1" end if --******************************************************************** Global LineNumberSelectedInList1 put LineNumberClicked into LineNumberSelectedInList1 end LineClickedWithIndent -------------------------------------------------------------- on LineClickedWithIndentAndPlus Global LineNumberClicked Global ItemClicked$ put the second word of the mouseline into LineNumberClicked --********** put the the value of the clickLine into ItemClicked$ --********** --SINCE THE ABOVE IS ALSO DONE BY TracebackSubroutine (BELOW), THERE IS NO REAL NEED TO REPEAT IT HERE call TracebackSubroutine Global PathToLineClicked$ Global HDPathToExpand$ put PathToLineClicked$ into HDPathToExpand$ Global InputDirectory$ put HDPathToExpand$ into field "Text1Field" of card "Card3" put word 1 to -1 of field "Text1Field" of card "Card3" into InputDirectory$ Global GotPathAlready put 1 into GotPathAlready call mouseUp of button "GetFolderButton" of card "Card3" --'************************************* --'THE ITEMS IN Card3.ListExpanded WILL ALSO NEED ANOTHER INDENT ADDED TO THEM --'************************************* --'The new segment is now in Card3.ListExpanded --'It will need indents added to it. put empty into field "List3" of card "Card1" put 0 into n repeat until n = LineNumberClicked -1 --Corrected (-1 now included) put n + 1 into n put ((field "List3" of card "Card1") & (line n of field "List1" of card "Card1") & return) into field "List3" of card "Card1" end repeat Global PathBlock$ --**** put (the number of characters in ItemClicked$ - the number of characters in PathBlock$ - 1) into NumberOfBlanks put empty into LHSBlanks$ put 0 into n repeat until n = NumberOfBlanks put n + 1 into n put LHSBlanks$ & space into LHSBlanks$ end repeat put LHSBlanks$ & "--" & PathBlock$ into NewItemClicked$ put field "List3" of card "Card1" & NewItemClicked$ & return into field "List3" of card "Card1" Global IndentSize put 0 into n put empty into PrecedingSpaces$ repeat until n = IndentSize put n + 1 into n put (PrecedingSpaces$ & space) into PrecedingSpaces$ end repeat ------------------------------------------------------- --PATCH Global LHSIndentInBlankChars put 0 into n put empty into PrecedingSpaces$ repeat until n = LHSIndentInBlankChars put n + 1 into n put (PrecedingSpaces$ & space) into PrecedingSpaces$ end repeat ------------------------------------------------------- put 0 into n delete the first line of field "ListExpandedField" of card "Card3" --********************** repeat until n = the number of lines in field "ListExpandedField" of card "Card3" put n + 1 into n put line n of field "ListExpandedField" of card "Card3" into ThisItem$ put (PrecedingSpaces$ & ThisItem$) into ThisItem$ put ((field "List3" of card "Card1") & ThisItem$ & return) into field "List3" of card "Card1" end repeat if the number of lines in field "List1" of card "Card1" > LineNumberClicked then put LineNumberClicked into n repeat until n = the number of lines in field "List1" of card "Card1" put n + 1 into n put line n of field "List1" of card "Card1" into ThisItem$ put ((field "List3" of card "Card1") & ThisItem$ & return) into field "List3" of card "Card1" end repeat end if --NewTreeNowMountedB: put empty into field "List1" of card "Card1" put 0 into n repeat until n = the number of lines in field "List3" of card "Card1" put n + 1 into n put line n of field "List3" of card "Card1" into ThisItem$ Put field "List1" of card "Card1" & ThisItem$ & return into field "List1" of card "Card1" end repeat put HDPathToExpand$ into field "Text2" of card "Card1" set the label of this stack to field "Text2" of card "Card1" put empty into field "List2" of card "Card1" if the number of lines in field "ListFilesField" of card "Card3" > 0 then put 0 into n repeat until n = the number of lines in field "ListFilesField" of card "Card3" put n + 1 into n put line n of field "ListFilesField" of card "Card3" into ThisItem$ put field "List2" of card "Card1" & ThisItem$ & return into field "List2" of card "Card1" end repeat end if --FilesAllListedB: select line LineNumberClicked of field "List1" of card "Card1" ------------------------------------------------------ Global InputDirectory$ put field "Text2" of card "Card1" into InputDirectory$ set the label of this stack to field "Text2" of card "Card1" put empty into field "ListFilesField" of card "Card3" set the defaultFolder to InputDirectory$ put the files into field "ListFilesField" of card "Card3" call filter_out_files sort lines of field "ListFilesField" of card "Card3" put field "ListFilesField" of card "Card3" into field "List2" of card "Card1" --*********** select line LineNumberClicked of field "List1" of card "Card1" end LineClickedWithIndentAndPlus -------------------------------------------------------------- on LineClickedWithIndentAndMinus --'e.g. --'--Program Files --' +Accessories --' +Adaptec --' --Adobe --' --Acrobat 5.0 --' +Help --' --Reader <--------------------YOU CLICKED HERE --'   ActiveX --'   Browser --'   JavaScripts --'   Legal --'   Optional --' --plug_ins --'   InterTrust --'   Movie --' +WEBBUY --'+rebol --'What you need to do here is to remove everything up to (but not including) --'EVERYTHING WITH A GREATER NUMBER OF INDENTS THAN THE LINE CLICKED until you --'find a line of equal or lesser indent. --'Then you need to change the line clicked into --' +Reader <--------------------YOU CLICKED HERE --'and show what files (if any) it contains. --'HOWEVER: --'You do not know what the path to "Reader" is. You need to do a TRACEBACK in order --'to discover the path. This can be done at any time before attempting to show --'the files. --'''''''''''''''''''''''''''''''''''''''''''' Global LineNumberClicked Global ItemClicked$ put the second word of the mouseline into LineNumberClicked --********** put the the value of the clickLine into ItemClicked$ --********** --SINCE THE ABOVE IS ALSO DONE BY TracebackSubroutine (BELOW), THERE IS NO REAL NEED TO REPEAT IT HERE call TracebackSubroutine --'Output is PathToLineClicked$ --'e.g. c:\Program Files\-Adobe (Windows) Global PathToLineClicked$ --'Rather than mess with the traceback routine itself, it is easier to remove the --'incorrect "-" here: put ((the number of chars in PathToLineClicked$) + 1) into n repeat until n = 1 put n - 1 into n put char n of PathToLineClicked$ into ThisChar$ if ThisChar$ = "/" then exit repeat --LINUX end repeat put n into LastBackslashPos --e.g. PathToLineClicked$ = c:\francis\-posto --N.B. minus sign in front of posto (Windows) put char 1 to LastBackslashPos of PathToLineClicked$ into LeftBit$ put char (LastBackslashPos + 2) to -1 of PathToLineClicked$ into RightBit$ put LeftBit$ & RightBit$ into PathToLineClicked$ put PathToLineClicked$ into field "Text2" of card "Card1" set the label of this stack to field "Text2" of card "Card1" --'''''''''''''''''''''''''''''''''''''''''''' --'What you need to do here is to remove everything up to (but not including) --'EVERYTHING WITH A GREATER NUMBER OF INDENTS THAN THE LINE CLICKED until you --'find a line of equal or lesser indent. --'Then you need to change the line clicked into --' +Reader <--------------------YOU CLICKED HERE --'and show what files (if any) it contains. --'''''''''''''''''''''''''''''''''''''''''''' --'Copy up to line before the one clicked: put empty into field "List3" of card "Card1" if LineNumberClicked > 0 then put 0 into n repeat until n = LineNumberClicked - 1 put n + 1 into n put line n of field "List1" of card "Card1" into ThisItem$ put field "List3" of card "Card1" & ThisItem$ & return into field "List3" of card "Card1" end repeat end if --NOTE THAT IN LIST 3, CURSOR IS PLACED AT LINE LineNumberClicked --CopiedUpToLineBeforeLineClickedIM: --'Now change -- into + and copy the line clicked: --'e.g. --' --Reader <--------------------YOU CLICKED HERE put word 1 to -1 of ItemClicked$ into ItemClickedWithoutLHSblanks$ put ((the number of chars in ItemClicked$) - (the number of chars in ItemClickedWithoutLHSblanks$)) into NumberOfBlanksOnLHSItemClicked put ItemClickedWithoutLHSblanks$ into ItemClicked$ put char 3 to -1 of ItemClicked$ into ItemClicked$ put empty into LHSBlanks$ put 0 into n repeat until n = NumberOfBlanksOnLHSItemClicked put n + 1 into n put LHSBlanks$ & space into LHSBlanks$ end repeat put LHSBlanks$ & "+" & ItemClicked$ into ItemClicked$ --'e.g. --' +Reader <--------------------YOU CLICKED HERE put ((field "List3" of card "Card1") & (ItemClicked$)) into field "List3" of card "Card1" --'What you need to do here is to remove everything up to (but not including) --'EVERYTHING WITH A GREATER NUMBER OF INDENTS THAN THE LINE CLICKED until you --'find a line of equal or lesser indent OR EOF. repeat with n = (LineNumberClicked + 1) to (the number of lines in field "List1" of card "Card1") put line n of field "List1" of card "Card1" into ThisItem$ put word 1 to -1 of ThisItem$ into ThisItemWithoutLHSBlanks$ put the number of chars in ThisItem$ - the number of chars in ThisItemWithoutLHSBlanks$ into NumberOfBlanksOnLHS If NumberOfBlanksOnLHS <= NumberOfBlanksOnLHSItemClicked Then exit repeat end repeat --FoundLineWithEqualOrLesserNumberOfIndentsIM: --'Copy rest of list: if n < the number of lines in field "List1" of card "Card1" then put field "List3" of card "Card1" & return into field "List3" of card "Card1" --*********************************** put n - 1 into n repeat until n = ((the number of lines in field "List1" of card "Card1") -1) put n + 1 into n put line n of field "List1" of card "Card1" into ThisItem$ put field "List3" of card "Card1" & ThisItem$ & return into field "List3" of card "Card1" end repeat put ((field "List3" of card "Card1") & (the last line of field "List1" of card "Card1")) into field "List3" of card "Card1" --i.e. the last line copied does not have return after it end if --CopiedRestOfListIM: --'Copy List3 back to List1: put field "List3" of card "Card1" into field "List1" of card "Card1" --'Show what files (if any) ItemClicked$ contains put empty into field "List2" ------------------------------------------------------ Global InputDirectory$ put field "Text2" of card "Card1" into InputDirectory$ set the label of this stack to field "Text2" of card "Card1" put empty into field "ListFilesField" of card "Card3" set the defaultFolder to InputDirectory$ put the files into field "ListFilesField" of card "Card3" call filter_out_files sort lines of field "ListFilesField" of card "Card3" select line LineNumberClicked of field "List1" of card "Card1" ------------------------------------------------------ if the number of lines of field "ListFilesField" of card "Card3" = 0 then pass LineClickedWithIndentAndMinus end if put field "ListFilesField" of card "Card3" into field "List2" of card "Card1" --ShownAllFilesIM: end LineClickedWithIndentAndMinus -------------------------------------------------------------- on LineClickedWithIndentAndChr160 --'e.g. --'+WINDOWS --'+WindowsME.BAK --'--WINICON --'   BIN <--------------------YOU CLICKED HERE --' +IPL --'You just need to show what files (if any) the clicked directory contains. --'HOWEVER: --'You do not know what the path to "BIN" is. You need to do a TRACEBACK in order --'to discover the path. This needs to be done before attempting to show --'the files. --''''''''''''''''''''''''''''''''''''''''''' Global LineNumberClicked Global ItemClicked$ put the second word of the mouseline into LineNumberClicked --********** put the the value of the clickLine into ItemClicked$ --********** --SINCE THE ABOVE IS ALSO DONE BY TracebackSubroutine (BELOW), THERE IS NO REAL NEED TO REPEAT IT HERE call TracebackSubroutine --'Output is PathToLineClicked$ Global PathToLineClicked$ --'e.g. --'c:\Program Files\Adobe\Acrobat 5.0\Reader\ Browser (Windows) --'This has an incorrect Chr$(160) inserted in the last path block. --'Rather than mess with the traceback routine itself, it is easier to remove the --'incorrect chr(160) here: put ((the number of chars in PathToLineClicked$) + 1) into n repeat until n = 1 put n - 1 into n put char n of PathToLineClicked$ into ThisChar$ if ThisChar$ = "/" then exit repeat --LINUX end repeat put n into LastBackslashPos --e.g. PathToLineClicked$ = c:\francis\ posto --N.B. chr$(160) sign in front of posto (Windows) put char 1 to LastBackslashPos of PathToLineClicked$ into LeftBit$ put char (LastBackslashPos + 2) to -1 of PathToLineClicked$ into RightBit$ put LeftBit$ & RightBit$ into PathToLineClicked$ --Form1.Text2.Text = PathToLineClicked$ put PathToLineClicked$ into field "Text2" of card "Card1" set the label of this stack to field "Text2" of card "Card1" --'Show files straight away: Global InputDirectory$ put field "Text2" of card "Card1" into InputDirectory$ put empty into field "List2" of card "Card1" --********************************** put empty into field "ListFilesField" of card "Card3" set the defaultFolder to InputDirectory$ put the files into field "ListFilesField" of card "Card3" call filter_out_files sort lines of field "ListFilesField" of card "Card3" select line LineNumberClicked of field "List1" of card "Card1" ------------------------------------------------------ if the number of lines of field "ListFilesField" of card "Card3" = 0 then pass LineClickedWithIndentAndChr160 end if put field "ListFilesField" of card "Card3" into field "List2" of card "Card1" end LineClickedWithIndentAndChr160 --------------------------------------------------------------------------------------------------------------- on TracebackSubroutine Global LineNumberClicked Global ItemClicked$ put the second word of the mouseline into LineNumberClicked put the the value of the clickLine into ItemClicked$ put 0 into n put empty into field "traceback_txt" of card "Card2" repeat until n = LineNumberClicked put (n + 1) into n put ((field "traceback_txt" of card "Card2") & (line n of field "List1" of card "Card1") & return) into field "traceback_txt" of card "Card2" end repeat Global SourceDirectory$ put SourceDirectory$ into field "TextSourceDirectory" of card "Card2" call Do_Traceback --'e.g. +Help Global PathBlock$ --*** put word 1 to -1 of ItemClicked$ into tempString$ put tempString$ into PathBlock$ put char 2 to -1 of PathBlock$ into PathBlock$ --*****************************corrected******* Global PathToLineClicked$ put field "TextPath" of card "Card2" & "/" & PathBlock$ into PathToLineClicked$ --LINUX end TracebackSubroutine --'#################################################################################### on Do_Traceback put 0 into n --***************** LabelBlock0 NO LONGER DELETED repeat until n = 30 put (n + 1) into n if exists(field ("LabelBlock" & n) of card "Card2") then delete field ("LabelBlock" & n) of card "Card2" --NOTE THAT THIS ALSO DELETES THE ORIGINAL LabelBlock0 field end if end repeat put empty into field "List1" of card "Card2" put 0 into Counter repeat until Counter = the number of lines in field "traceback_txt" of card "Card2" put (Counter + 1) into Counter put ((field "List1" of card "Card2") & (line Counter of field "traceback_txt" of card "Card2") & return) into field "List1" of card "Card2" end repeat put Counter into NumberOfLinesInTracebackFile --'It is the last line in this file that needs to be traced back put Counter into field "LabelNumberOfLinesInTracebackFile" of card "Card2" put Counter into LastLineListNumber put LastLineListNumber into field "LabelLastLineListNumber" of card "Card2" put 0 into Counter put 0 into n repeat until n = LastLineListNumber put n + 1 into n put line n of field "List1" of card "Card2" into ThisItem$ if char 1 of ThisItem$ <> " " Then put n into Counter end if end repeat put Counter into TracebackLineNumber put TracebackLineNumber into field "LabelTracebackLineNumber" of card "Card2" put Counter into TracebackListNumber put TracebackListNumber into field "LabelTracebackListNumber" of card "Card2" put the last line of field "List1" of card "Card2" into LastLineInTracebackFile$ put word 1 to -1 of LastLineInTracebackFile$ into trimmedString$ put ((the number of chars in LastLineInTracebackFile$) - (the number of chars in trimmedString$)) into NumberOfBlanksOnLHSOfLastLineInTracebackFile --'************************************************************************************** put NumberOfBlanksOnLHSOfLastLineInTracebackFile + 1 into NumberOfBlanksOnLHSOfLastLineInTracebackFile --'THE ADDITION OF 1 TO THIS VALUE IS SIMPLY TO MAKE SURE THE PROGRAM DETECTS THE --'DIFFERENCE IN INDENT in relation to the previous item being traced back --'(see also correction at ###). --'************************************************************************************** --'NumberOfPrecedingBlanksPreviousLine = NumberOfBlanksOnLHSOfLastLineInTracebackFile --NumberOfPrecedingBlanksPreviousLine = NumberOfBlanksOnLHSOfLastLineInTracebackFile - 1 'to compensate for the adjustment above put NumberOfBlanksOnLHSOfLastLineInTracebackFile - 1 into NumberOfPrecedingBlanksPreviousLine --'The above compensates for the "artificial" adjustment of 1 made immediately above, --'OTHERWISE THE "ERROR" IS CARRIED FORWARD IN NumberOfPrecedingBlanksPreviousLine --'AND CONTINUES GROWING!!!!! put 0 into Counter repeat with c = LastLineListNumber down to TracebackListNumber put line c of field "List1" of card "Card2" into ThisItem$ --**************************************************** --SOMEHOW OR OTHER, BLANKS ARE GETTING PUT ON THE RHS OF --ThisItem$, causing this routine not to be executed --correctly. Until the cause is found, the following --patch simply lops off the blanks put char 1 to length(word 1 to -1 of ThisItem$) + (offset(word 1 of ThisItem$, ThisItem$) - 1) of ThisItem$ into ThisItem$ --**************************************************** put word 1 to -1 of ThisItem$ into trimmedItem$ put ((the number of chars in ThisItem$) - (the number of chars in trimmedItem$)) into NumberOfPrecedingBlanksThisLine put trimmedItem$ into ThisItem$ if char 1 to 2 of ThisItem$ = "--" And NumberOfPrecedingBlanksThisLine < NumberOfPrecedingBlanksPreviousLine Then put NumberOfPrecedingBlanksThisLine into NumberOfPrecedingBlanksPreviousLine put Counter + 1 into Counter clone field "LabelBlock0" of card "Card2" set the name of it to ("LabelBlock" & Counter) set the visible of field ("LabelBlock" & Counter) of card "Card2" to true --PROBABLY NOT NEC set the left of field ("LabelBlock" & Counter) of card "Card2" to (the left of field ("LabelBlock" & (Counter -1)) of card "Card2" + the width of field ("LabelBlock" & (Counter -1)) of card "Card2") set the top of field ("LabelBlock" & Counter) of card "Card2" to the top of field "LabelBlock0" of card "Card2" put char 3 to -1 of ThisItem$ into field ("LabelBlock" & Counter) of card "Card2" end if end repeat put field "TextSourceDirectory" of card "Card2" into field "LabelBlock0" of card "Card2" --'Blocks 1 onwards are in the wrong order, so reverse them to make the path: put field "LabelBlock0" of card "Card2" into OutputPath$ if the last char of OutputPath$ <> "/" Then put OutputPath$ & "/" into OutputPath$ --LINUX repeat with c = Counter down to 1 put OutputPath$ & field ("LabelBlock" & c) of card "Card2" & "/" into OutputPath$ --LINUX end repeat ------------------------------------------------------------------ put char 1 to -2 of OutputPath$ into OutputPath$ put OutputPath$ into field "TextPath" of card "Card2" end D