#!/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 "$@" 1 PictureChooser 3 ˆjÆ 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 set the top of field "Text2" of card "Card1" to the bottom of field "List1" of card "Card1" show_drives get_ini_parameters call mouseDown of field "DriveField" of card "Card1" --of stack "HDTree" delete line 1 of field "List1" of card "Card1" --of stack "HDTree" --******************* --------------------------------------------------- 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" --of stack "HDTree" 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. c:\): --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): ----------------------------------------- put line 1 of field "IniParametersField" of card "Card4" of this stack into SourceDirectory$ --e.g. "c:\" 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$ put word 1 to -1 of SourceDirectory$ into SourceDirectory$ Global StartupPath$ put SourceDirectory$ into StartupPath$ --e.g. c:\francis\posto or c:\francis\posto\ if the last char of StartupPath$ = "\" then put char 1 to -2 of StartupPath$ into StartupPath$ end if put char 1 to 3 of SourceDirectory$ into SourceDirectory$ --e.g. c:\ --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 "c:\" into SourceDirectory$ if IndentSize = "" then put 8 into IndentSize if TreeFontname$ = "" then put "Arial" into TreeFontname$ if TreeFontsize = "" then put 12 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 put the first character of SourceDirectory$ into tempVar --put the backgroundcolor of field "DriveField1" into tempBackColour --put the foregroundcolor of field "DriveField1" into tempForeColour --put 236,233,216 into tempBackColour 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$ ----------------------------------------- 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$ Global PreviewPictureHeight put line 12 of field "IniParametersField" of card "Card4" of this stack into PreviewPictureHeight 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 field "DriveField1" + 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 field "DriveField1" + 10) set the top of field "List2" to (the bottom of field "DriveField1" + 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 put URL "file:_picture_chooser_filters.ini" into button "Filters" of card "Card1" 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 put "*.* All files" into button "Filters" of card "Card1" of this stack end if -------------------------------------------------------------------------- --Global NumberOfDrives Put 0 into Counter repeat for each line ThisLine in field "DriveField" put (Counter + 1) into Counter if the text of field ("DriveField" & Counter) = tempVar then set the backgroundcolor of field ("DriveField" & Counter) to tempForeColour set the foregroundcolor of field ("DriveField" & Counter) to tempBackColour Global GotPathAlready if GotPathAlready <> 1 then --***************************** Global WidgetFolder$ put the defaultfolder into WidgetFolder$ replace "/" with "\" in WidgetFolder$ if the last char of WidgetFolder$ is "\" then put char 1 to -2 of WidgetFolder$ into WidgetFolder$ end if --***************************** remove_all_drivebox_highlights call mouseDown of field ("DriveField" & Counter) --*************************** end if exit repeat end if end repeat 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 Global tempForeColour Global tempBackColour set the backgroundcolor of field "DriveField" to tempBackColour set the foregroundcolor of field "DriveField" to tempForeColour Put 0 into Counter repeat for each line ThisLine in field "DriveField" put (Counter + 1) into Counter set the backgroundcolor of field ("DriveField" & Counter) to tempBackColour set the foregroundcolor of field ("DriveField" & Counter) to tempForeColour end repeat 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 set the backgroundcolor of field "DriveField1" to tempBackColour set the foregroundcolor of field "DriveField1" to tempForeColour end error_reading_diskette on get_startup_folder Global Init if Init = 1 then pass get_startup_folder Global SourceDirectory$ --e.g. c:\ Global StartupPath$ --e.g. c:\francis\posto 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$ end if put InputDirectory$ into field "Text1Field" of card "Card3" --e.g. InputDirectory$: --d:\program files\howsoft\html slideshow --Get the items of this string and put them into LabelBlockField0, LabelBlockField1 .... --put characters 1 to 3 of InputDirectory$ into field "LabelBlockField0" --WRONG --set the text of field "LabelBlockField0" to (characters 1 to 3 of InputDirectory$) --WRONG --set the itemDelimiter to "/" --N.B NOT "\" set the itemDelimiter to "\" --*****************changed************** 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 --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 field "DriveField1" + 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 field "DriveField1" + 10) set the top of field "List2" to (the bottom of field "DriveField1" + 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 € Ú@| PictureChooser @|ÿÿÿÿ U Tahoma U Arial U Arial W Arial W Arial W Arial U Arial U Arial $ U Arial $ W Arial U U Arial cRevStandaloneSettings ;scriptLibraries Internet Geometry PrintingMacOSX false OSX,name HDTreeMacOS,documentType UNIX,fileSelector trueWindows trueWindows,Comments Author: Robert J WarrenWindows,LegalCopyright .2006 howsoft.com All rights reserved worldwideMacOS,longVersion HDTree 1.0.0.0UNIX,pageSetup trueOSX,documentType Linux falseOdt falseinclusions selectWindows,documenticonFile ;D:/Program Files/Revolution 2.6/Sample Icons/genericdoc.ico answerDialog trueSPARC false SolIntel falseOSX,documentExtension Windows,FileDescription "Picture Chooser 1.0 for Windows XPOSX,longVersion HDTree 1.0.0.0 MacOSfat falseOSX,copyright .2005 howsoft.com All rights reserved worldwideUNIX,printerChooser trueMacOS,MinimumSize 15000MacOS,versionnumber1 1MacOS,versionnumber2 0MacOS,Release FinalOSX,identifier com.howsoft.com.hdtreename _picture_chooserMacOS,versionnumber3 0Hp9k700 falsers6000 false MacOS,Region 1OSX,shortVersion 1.0.0.0Windows,fileversion1 1Windows,productversion1 1Windows,fileversion2 1Windows,productversion2 1Windows,fileversion3 0Bsd falsecursors trueWindows,productversion3 0Windows,fileversion4 0Windows,productversion4 0 OSX,info HDTree Version 1.0.0.0 MacOS68k falseMacOS,dynamicMemory trueIris false askDialog trueOSX,signature ????Windows,iconFile h_nearly_red_all_resolutions.icoMacOS,PreferredSize 15000Windows,ProductName Picture ChooserUNIX,colorChooser true MacOSPPC falseWindows,companyname howsoft.com SolSparc falseMacOS,creator ???? cREVGeometryCache stackID 1073 cREVGeneral scriptChecksum &†3óyQ›@?4¹ªÉæÕ bookmarks handlerList «preOpenStack resumeStack resizeStack show_drives get_ini_parameters iconifyStack remove_all_drivebox_highlights error_reading_diskette get_startup_folder Position_ControlstempScript prevHandler preOpenStackscriptSelection char 27297 to 27296script °D
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
set the top of field "Text2" of card "Card1" to the bottom of field "List1" of card "Card1"
show_drives
get_ini_parameters
call mouseDown of field "DriveField" of card "Card1" --of stack "HDTree"
delete line 1 of field "List1" of card "Card1" --of stack "HDTree" --*******************
---------------------------------------------------
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" --of stack "HDTree"
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. c:\):
--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):
-----------------------------------------
put line 1 of field "IniParametersField" of card "Card4" of this stack into SourceDirectory$ --e.g. "c:\" 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$
put word 1 to -1 of SourceDirectory$ into SourceDirectory$
Global StartupPath$
put SourceDirectory$ into StartupPath$ --e.g. c:\francis\posto or c:\francis\posto\
if the last char of StartupPath$ = "\" then
put char 1 to -2 of StartupPath$ into StartupPath$
end if
put char 1 to 3 of SourceDirectory$ into SourceDirectory$ --e.g. c:\
--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 "c:\" into SourceDirectory$
if IndentSize = "" then put 8 into IndentSize
if TreeFontname$ = "" then put "Arial" into TreeFontname$
if TreeFontsize = "" then put 12 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
put the first character of SourceDirectory$ into tempVar
--put the backgroundcolor of field "DriveField1" into tempBackColour
--put the foregroundcolor of field "DriveField1" into tempForeColour
--put 236,233,216 into tempBackColour
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$
-----------------------------------------
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$
Global PreviewPictureHeight
put line 12 of field "IniParametersField" of card "Card4" of this stack into PreviewPictureHeight
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 field "DriveField1" + 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 field "DriveField1" + 10)
set the top of field "List2" to (the bottom of field "DriveField1" + 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
put URL "file:_picture_chooser_filters.ini" into button "Filters" of card "Card1" 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
put "*.* All files" into button "Filters" of card "Card1" of this stack
end if
--------------------------------------------------------------------------
--Global NumberOfDrives
Put 0 into Counter
repeat for each line ThisLine in field "DriveField"
put (Counter + 1) into Counter
if the text of field ("DriveField" & Counter) = tempVar then
set the backgroundcolor of field ("DriveField" & Counter) to tempForeColour
set the foregroundcolor of field ("DriveField" & Counter) to tempBackColour
Global GotPathAlready
if GotPathAlready <> 1 then
--*****************************
Global WidgetFolder$
put the defaultfolder into WidgetFolder$
replace "/" with "\" in WidgetFolder$
if the last char of WidgetFolder$ is "\" then
put char 1 to -2 of WidgetFolder$ into WidgetFolder$
end if
--*****************************
remove_all_drivebox_highlights
call mouseDown of field ("DriveField" & Counter) --***************************
end if
exit repeat
end if
end repeat
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
Global tempForeColour
Global tempBackColour
set the backgroundcolor of field "DriveField" to tempBackColour
set the foregroundcolor of field "DriveField" to tempForeColour
Put 0 into Counter
repeat for each line ThisLine in field "DriveField"
put (Counter + 1) into Counter
set the backgroundcolor of field ("DriveField" & Counter) to tempBackColour
set the foregroundcolor of field ("DriveField" & Counter) to tempForeColour
end repeat
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
set the backgroundcolor of field "DriveField1" to tempBackColour
set the foregroundcolor of field "DriveField1" to tempForeColour
end error_reading_diskette
on get_startup_folder
Global Init
if Init = 1 then pass get_startup_folder
Global SourceDirectory$ --e.g. c:\
Global StartupPath$ --e.g. c:\francis\posto
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$
end if
put InputDirectory$ into field "Text1Field" of card "Card3"
--e.g. InputDirectory$:
--d:\program files\howsoft\html slideshow
--Get the items of this string and put them into LabelBlockField0, LabelBlockField1 ....
--put characters 1 to 3 of InputDirectory$ into field "LabelBlockField0" --WRONG
--set the text of field "LabelBlockField0" to (characters 1 to 3 of InputDirectory$) --WRONG
--set the itemDelimiter to "/" --N.B NOT "\"
set the itemDelimiter to "\" --*****************changed**************
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
--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 field "DriveField1" + 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 field "DriveField1" + 10)
set the top of field "List2" to (the bottom of field "DriveField1" + 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 € @| cREVGeometryCacheIDs 1136678675556 10731136222147167 10651136243598395 10661136244250907 10681118887613718 10121136297627586 10691118892123274 10131118793845487 10061131039307932 10491118863130578 10081118793781548 1004 cREVGeometrycache order total 11 cREVGeneral scriptChecksum ¹Ãúúœ«Í']‹¸¤Ó®¬" bookmarks handlerList openCardtempScript prevHandler openCardscriptSelection char 15 to 14scripton 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 ñ Card2 @ € @| cREVGeometryCacheIDs 1133977327166 10561134039519824 10601133977612235 10591133977215380 10551133977086796 10541133976982003 10531133976894579 10521133977512847 10581133977427446 1057 cREVGeneral bookmarks handlerList prevHandler tempScript script cREVGeometryCache total 9order ! " # $ ò Card3 @ € @| cREVGeometryCacheIDs 1119190048195 10351119190816768 10441119189931159 10311119189985468 10331119307150731 10471119189455452 10281136311191229 10701119190793357 10421119189777949 10301119190612056 10401119190806827 10431119190588911 10391119189538606 10291119190165934 10371136400604207 10721119190784587 10411119190535316 1038 cREVGeometryCache total 17order . 0 ó Card4 @ € @| cREVGeometryCacheIDs 1136215150469 10641136214694160 10631119121093971 1015 cREVGeometryCache total 3order ÷ ' ( ì 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 put SourceDirectory$ & PathBlock$ into HDPathToExpand$ Else put SourceDirectory$ & "\" & PathBlock$ into HDPathToExpand$ 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 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 --ThisItem$ = Form1.List1.List(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 put char 1 to -2 of DriveEtcBit$ into DriveEtcBit$ end if put (DriveEtcBit$ & "\" & EndBlock$) into 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: 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 --'Now copy rest of file: 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 put char 1 to -2 of DriveEtcBit$ into DriveEtcBit$ end if put (DriveEtcBit$ & "\" & EndBlock$) into 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: 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 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 (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 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 end repeat put n into LastBackslashPos --e.g. PathToLineClicked$ = c:\francis\-posto --N.B. minus sign in front of posto 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: --Form1.List3.Clear put empty into field "List3" of card "Card1" --If LineNumberClicked = 0 Then GoTo CopiedUpToLineBeforeLineClickedIM 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 --Form1.List3.AddItem ItemClicked$ 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 --'PathToLineClicked$ 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 --'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 end repeat put n into LastBackslashPos --e.g. PathToLineClicked$ = c:\francis\ posto --N.B. chr$(160) sign in front of posto 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" ------------------------------------------------------ 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$ 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 ###). --'************************************************************************************** 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$ ------------------------------------------------------------------ repeat with c = Counter down to 1 put OutputPath$ & field ("LabelBlock" & c) of card "Card2" & "\" into OutputPath$ end repeat ------------------------------------------------------------------ put char 1 to -2 of OutputPath$ into OutputPath$ put OutputPath$ into field "TextPath" of card "Card2" end Do_Traceback --------------------------------------------------------------------------------------------------------------- on filter_out_files put the selectedText of button "Filters" of card "Card1" into currentSelectedFilter$ --e.g. *.* All files if (word 1 of currentSelectedFilter$ <> "*.*") and (the number of lines of field "ListFilesField" of card "Card3" > 0) then put word 1 of currentSelectedFilter$ into FilterSelected$ --e.g. *.* repeat with n = 1 to the number of chars in FilterSelected$ put char n of FilterSelected$ into ThisChar$ if ThisChar$ = "." then exit repeat end repeat put n into dotPosition put char dotPosition to -1 of FilterSelected$ into dotAndSuffixOfCurrentFilter$ put toLower(dotAndSuffixOfCurrentFilter$) into LowerCasedotAndSuffixOfCurrentFilter$ put empty into field "FilteredFiles" of card "Card3" repeat with n = 1 to the number of lines of field "ListFilesField" of card "Card3" put line n of field "ListFilesField" of card "Card3" into ThisLine$ put toLower(ThisLine$) into LowerCaseThisLine$ --e.g. tomas.JPG -- N.B. Capital letters --IF YOU DELETE LINES DURING THIS REPEAT, YOU MAY HAVE CONFUSION RE-DEFINING ThisLine$ CORRECTLY. --IT MIGHT BE SAFER TO CREATE A NEW FIELD. if matchChunk(LowerCaseThisLine$, LowerCasedotAndSuffixOfCurrentFilter$) is true and LowerCaseThisLine$ <> "" then put (the number of chars in LowerCasedotAndSuffixOfCurrentFilter$) into SuffixLength put (-1 * SuffixLength) into SuffixLength put 1 into MatchIsOK repeat with s = SuffixLength down to -1 -- or DOWN to ??? put char s of LowerCaseThisLine$ into a put char s of LowerCasedotAndSuffixOfCurrentFilter$ into b if a <> b then put 0 into MatchIsOK end repeat if MatchIsOK = 1 then put field "FilteredFiles" of card "Card3" & ThisLine$ & return into field "FilteredFiles" of card "Card3" end if end if end repeat --delete the last char (return) of field "FilteredFiles": if the charToNum of the last char of field "FilteredFiles" of card "Card3" = 10 then delete the last char of field "FilteredFiles" of card "Card3" end if put field "FilteredFiles" of card "Card3" into field "ListFilesField" of card "Card3" end if end filter_out_files € * R P cREVGeneral @ scriptChecksum ß³ˆÑ¶XÄ0LNÝ%o¨ bookmarks revUniqueID 1118793781548handlerList .rawKeyDown mouseDown LineClickedWithNoIndent LineClickedWithNoIndentButPlus LineClickedWithNoIndentButMinus LineClickedWithNoIndentButChr160 LineClickedWithIndent LineClickedWithIndentAndPlus LineClickedWithIndentAndMinus LineClickedWithIndentAndChr160 TracebackSubroutine Do_Traceback filter_out_filesscriptSelection char 39636 to 39635prevHandler mouseUptempScript script wô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
--************************************************