--- a/FileSelectionBox.st Wed Sep 09 22:10:13 1998 +0200
+++ b/FileSelectionBox.st Wed Sep 09 22:27:16 1998 +0200
@@ -308,45 +308,19 @@
"Modified: / 9.9.1998 / 21:23:16 / cg"
!
-directory
- "return the directory which is currently shown"
-
- ^ selectionList directory
+ied: / 9.9.1998 / 21:23:16 / cg"
!
-directory:directoryName
- "change the directory shown in the list."
-
- selectionList directory:directoryName
+^ selectionList directory
!
-fileName
- "if some filename has been entered, return it (without the directory path)
- otherwise, return nil"
-
- |string|
-
- string := super contents.
- string isNil ifTrue:[^ nil].
- ^ self pathName asFilename baseName
-
- "Modified: / 12.8.1998 / 09:54:01 / cg"
+tionList directory:directoryName
!
-matchBlock:aBlock
- "set the matchBlock (in the selectionList). Only files
- for which the block returns true are shown.
- The matching is actually done in the fileSelectionList."
-
- selectionList matchBlock:aBlock
+ed: / 12.8.1998 / 09:54:01 / cg"
!
-openOn:aPath
- "open the box showing files in aPath.
- This is only a shortcut message - no new functionality."
-
- self directory:aPath.
- self showAtPointer
+selectionList matchBlock:aBlock
!
pathName
@@ -356,38 +330,9 @@
^ self contents
!
-pattern:aPattern
- "set the pattern - this also enables the PatternField
- (if the pattern is non-nil) or hides it (if nil)."
-
- |focusSequence|
+entered"
- patternField initialText:aPattern.
- selectionList pattern:aPattern.
- aPattern isNil ifTrue:[
- patternField beInvisible.
- self makeUntabable:patternField.
- focusSequence := (Array
- with:enterField
- with:selectionList
- with:okButton
- with:abortButton)
- ] ifFalse:[
- patternField beVisible.
- self makeTabable:patternField before:enterField.
- focusSequence := (Array
- with:patternField
- with:enterField
- with:selectionList
- with:okButton
- with:abortButton)
- ].
-
- windowGroup notNil ifTrue:[
- windowGroup focusSequence:focusSequence
- ].
-
- "Modified: 18.10.1997 / 03:02:05 / cg"
+ ^ self contents
!
selectingDirectory:aBoolean
@@ -431,159 +376,30 @@
!FileSelectionBox methodsFor:'initialization'!
-createEnterField
- "if the (optional) class FilenameEditField is present, use
- it, since it provides filename completion. Otherwise, we have
- to live with the dumb (default) field ...
- "
- FilenameEditField notNil ifTrue:[
- ^ FilenameEditField new.
- ].
- ^ super createEnterField
+ionBox methodsFor:'initialization'!
- "Modified: 18.4.1996 / 20:02:24 / cg"
+fied: 18.4.1996 / 20:02:24 / cg"
!
-initialize
- |corner|
-
- super initialize.
- selectingDirectory := false.
-
- label := resources string:'File dialog'.
-
- labelField extent:(0.7 @ labelField height).
- labelField label:(resources string:'select a file:').
- labelField adjust:#left.
-
- patternField := EditField in:self.
- self is3D ifTrue:[
- corner := (1.0 @ (labelField origin y+patternField heightIncludingBorder)).
- ] ifFalse:[
- corner := [(width - ViewSpacing - (patternField borderWidth * 2)) @ (labelField origin y+patternField height"IncludingBorder")].
- ].
- patternField origin:(0.7 @ labelField origin y) corner:corner.
- patternField rightInset:ViewSpacing.
- patternField initialText:'*'.
- patternField leaveAction:[:reason | self patternChanged].
- patternField crAction:[self patternChanged].
- patternField hiddenOnRealize:true. "delay showing, until a pattern is defined"
-"/ no, since its invisible
-"/ self makeTabable:patternField before:enterField.
-
- enterField addDependent:self.
-
- "
- FileSelectionBox open
- FileSelectionBox new show
- "
-
- "Modified: 18.10.1997 / 02:47:49 / cg"
-!
-
-postRealize
- "if some default is present in the enterField,
- scroll to make this one visible"
-
- |contents|
-
- super postRealize.
- (contents := enterField contents) notNil ifTrue:[
- contents notEmpty ifTrue:[
- selectionList makeVisible:contents
- ]
- ]
-
- "Created: 24.7.1997 / 18:19:14 / cg"
+ied: 18.10.1997 / 02:47:49 / cg"
! !
!FileSelectionBox methodsFor:'private'!
-updateList
- selectionList updateList
-! !
+eSelectionBox methodsFor:'private'! !
!FileSelectionBox methodsFor:'queries'!
-preferredExtent
- "return my preferred extent - thats the minimum size
- to make everything visible"
-
- |wWanted hWanted mm|
-
- "/ If I have an explicit preferredExtent ..
-
- preferredExtent notNil ifTrue:[
- ^ preferredExtent
- ].
-
- mm := ViewSpacing.
-
- wWanted := mm +
- labelField preferredExtent x +
- (mm * 2) +
- patternField preferredExtent x +
- mm.
- (wWanted < width) ifTrue:[
- wWanted := width
- ].
- hWanted := mm + labelField height +
- mm + enterField height +
- mm + selectionList height +
- mm + buttonPanel preferredExtent y +
- mm.
-
- (hWanted < height) ifTrue:[
- hWanted := height
- ].
- ^ (wWanted @ hWanted)
-
- "Modified: 19.7.1996 / 20:44:04 / cg"
-! !
+eSelectionBox methodsFor:'queries'! !
!FileSelectionBox methodsFor:'user actions'!
-directoryChanged
- selectingDirectory ifTrue:[
- selectionList changeDirectory.
- enterField contents:(selectionList directory pathName).
- selectionList setSelection:nil.
- ].
+ctionBox methodsFor:'user actions'!
- "Created: 18.4.1996 / 18:38:21 / cg"
- "Modified: 25.5.1996 / 12:27:05 / cg"
+fied: 25.5.1996 / 12:27:05 / cg"
!
-directorySelected
- "a directory was selected - show the new path in the inputField,
- if we are in directory mode"
-
- selectingDirectory ifTrue:[
- |newDir|
-
- newDir := (selectionList directory)
- construct:selectionList selectionValue.
- enterField contents:newDir pathName.
- ].
-
- "Created: / 18.4.1996 / 18:46:15 / cg"
- "Modified: / 7.8.1998 / 17:19:26 / cg"
-!
-
-doubleClick
- |entry|
-
- entry := selectionList selectionValue.
- entry notNil ifTrue:[
- ((selectionList directory asFilename construct:entry) isDirectory) ifFalse:[
- selectingDirectory ifFalse:[
- enterField contents:entry.
- self okPressed
- ]
- ]
- ].
-
- "Modified: 19.10.1997 / 00:17:37 / cg"
+ied: / 7.8.1998 / 17:19:26 / cg"
!
okPressed
@@ -616,34 +432,29 @@
super okPressed
- "Modified: / 9.9.1998 / 21:21:14 / cg"
+<<<<<<< FSelBox.st
+ "Modified: / 9.9.1998 / 21:42:33 / cg"
!
-patternChanged
- selectionList pattern:patternField contents.
+].
+ ].
+
+ super okPressed
+
+ "Modified: / 9.9.1998 / 21:21:14 / cg"
+=======
+ "Modified: / 9.9.1998 / 21:21:14 / cg"
+>>>>>>> 1.52
+!
+
+:patternField contents.
self updateList
"Created: 4.6.1996 / 20:30:23 / cg"
-!
-
-selectionChanged
- |entry|
-
- entry := selectionList selectionValue.
- (selectionList directory asFilename construct:entry) type == #directory ifFalse:[
- selectingDirectory ifTrue:[
- enterField contents:(selectionList directory pathName).
- selectionList setSelection:nil.
- ^ self
- ]
- ].
- enterField contents:entry
-
- "Modified: 21.9.1997 / 12:07:55 / cg"
! !
!FileSelectionBox class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.52 1998-09-09 20:10:13 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.53 1998-09-09 20:27:16 cg Exp $'
! !