added a separate directoryChangeAction
authorClaus Gittinger <cg@exept.de>
Tue, 05 Mar 1996 02:38:29 +0100
changeset 472 17f795e6ecba
parent 471 9dcbc67366ee
child 473 e810b5bd6bad
added a separate directoryChangeAction
FSelList.st
FileSelectionList.st
--- a/FSelList.st	Tue Mar 05 01:41:39 1996 +0100
+++ b/FSelList.st	Tue Mar 05 02:38:29 1996 +0100
@@ -14,7 +14,8 @@
 	instanceVariableNames:'pattern directory timeStamp directoryId directoryName
 		directoryContents directoryFileTypes fileTypes realAction
 		matchBlock stayInDirectory ignoreParentDirectory markDirectories
-		ignoreDirectories directoryChangeCheckBlock quickDirectoryChange'
+		ignoreDirectories directoryChangeCheckBlock quickDirectoryChange
+		directoryChangeAction'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Views-Text'
@@ -325,6 +326,14 @@
     realAction := aBlock
 !
 
+directoryChangeAction:aBlock
+    "set the action to be performed on a directory change"
+
+    directoryChangeAction := aBlock
+
+    "Created: 5.3.1996 / 02:37:08 / cg"
+!
+
 directoryChangeCheckBlock:aBlock
     "set the directoryChangeCheckBlock - if non-nil, it controls if
      a directory change is legal."
@@ -482,7 +491,11 @@
     self selectionIsDirectory ifTrue:[
         stayInDirectory not ifTrue:[
             quickDirectoryChange ifFalse:[
-                self changeDirectory
+                directoryChangeAction notNil ifTrue:[
+                    directoryChangeAction value:self selection
+                ] ifFalse:[
+                    self changeDirectory
+                ]
             ]
         ].
         ^ self
@@ -490,7 +503,7 @@
     super doubleClicked
 
     "Created: 4.3.1996 / 17:39:58 / cg"
-    "Modified: 4.3.1996 / 17:50:11 / cg"
+    "Modified: 5.3.1996 / 02:38:06 / cg"
 !
 
 selectionChanged
@@ -500,7 +513,11 @@
     self selection isCollection ifFalse:[
         self selectionIsDirectory ifTrue:[
             (stayInDirectory not and:[quickDirectoryChange]) ifTrue:[
-                self changeDirectory
+                directoryChangeAction notNil ifTrue:[
+                    directoryChangeAction value:self selection
+                ] ifFalse:[
+                    self changeDirectory
+                ]
             ]
         ] ifFalse:[
             realAction notNil ifTrue:[
@@ -509,7 +526,7 @@
         ]
     ]
 
-    "Modified: 4.3.1996 / 17:44:44 / cg"
+    "Modified: 5.3.1996 / 02:37:58 / cg"
 !
 
 sizeChanged:how
@@ -745,5 +762,5 @@
 !FileSelectionList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSelList.st,v 1.25 1996-03-05 00:08:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSelList.st,v 1.26 1996-03-05 01:38:29 cg Exp $'
 ! !
--- a/FileSelectionList.st	Tue Mar 05 01:41:39 1996 +0100
+++ b/FileSelectionList.st	Tue Mar 05 02:38:29 1996 +0100
@@ -14,7 +14,8 @@
 	instanceVariableNames:'pattern directory timeStamp directoryId directoryName
 		directoryContents directoryFileTypes fileTypes realAction
 		matchBlock stayInDirectory ignoreParentDirectory markDirectories
-		ignoreDirectories directoryChangeCheckBlock quickDirectoryChange'
+		ignoreDirectories directoryChangeCheckBlock quickDirectoryChange
+		directoryChangeAction'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Views-Text'
@@ -325,6 +326,14 @@
     realAction := aBlock
 !
 
+directoryChangeAction:aBlock
+    "set the action to be performed on a directory change"
+
+    directoryChangeAction := aBlock
+
+    "Created: 5.3.1996 / 02:37:08 / cg"
+!
+
 directoryChangeCheckBlock:aBlock
     "set the directoryChangeCheckBlock - if non-nil, it controls if
      a directory change is legal."
@@ -482,7 +491,11 @@
     self selectionIsDirectory ifTrue:[
         stayInDirectory not ifTrue:[
             quickDirectoryChange ifFalse:[
-                self changeDirectory
+                directoryChangeAction notNil ifTrue:[
+                    directoryChangeAction value:self selection
+                ] ifFalse:[
+                    self changeDirectory
+                ]
             ]
         ].
         ^ self
@@ -490,7 +503,7 @@
     super doubleClicked
 
     "Created: 4.3.1996 / 17:39:58 / cg"
-    "Modified: 4.3.1996 / 17:50:11 / cg"
+    "Modified: 5.3.1996 / 02:38:06 / cg"
 !
 
 selectionChanged
@@ -500,7 +513,11 @@
     self selection isCollection ifFalse:[
         self selectionIsDirectory ifTrue:[
             (stayInDirectory not and:[quickDirectoryChange]) ifTrue:[
-                self changeDirectory
+                directoryChangeAction notNil ifTrue:[
+                    directoryChangeAction value:self selection
+                ] ifFalse:[
+                    self changeDirectory
+                ]
             ]
         ] ifFalse:[
             realAction notNil ifTrue:[
@@ -509,7 +526,7 @@
         ]
     ]
 
-    "Modified: 4.3.1996 / 17:44:44 / cg"
+    "Modified: 5.3.1996 / 02:37:58 / cg"
 !
 
 sizeChanged:how
@@ -745,5 +762,5 @@
 !FileSelectionList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionList.st,v 1.25 1996-03-05 00:08:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionList.st,v 1.26 1996-03-05 01:38:29 cg Exp $'
 ! !