[ENH]FileList
Karl Ramberg
karl.ramberg at chello.se
Sun May 21 19:27:21 UTC 2000
A small test of the ScrollPane enhancement.
Obs two versions: one that uses Markus Denkers Layouts 3 named
'FileListLayouts.1.cs'
one regular: 'FileList.1.cs'
Karl
-------------- next part --------------
'From Squeak2.8alpha of 19 February 2000 [latest update: #2121] on 21 May 2000 at 9:26:17 pm'!
!FileList class methodsFor: 'instance creation' stamp: 'kfr 5/21/2000 21:25'!
openAsMorph
"Open a morphic view of a FileList on the default directory."
| dir aFileList window fileListTop |
dir _ FileDirectory default.
aFileList _ self new directory: dir.
window _ (SystemWindow labelled: dir pathName) model: aFileList.
window addMorph: ((PluggableListMorph on: aFileList list: #volumeList selected: #volumeListIndex
changeSelected: #volumeListIndex: menu: #volumeMenu:) autoDeselect: false)
frame: (0 at 0 corner: 0.3 at 0.2).
window addMorph: ((PluggableTextMorph on: aFileList text: #pattern accept: #pattern:) scrollBarHidden: true)
frame: (0 at 0.2 corner: 0.3 at 0.3).
Preferences optionalButtons
ifTrue:
[window addMorph: aFileList optionalButtonRow frame: (0.3 @ 0 corner: 1 @ 0.08).
fileListTop _ 0.08]
ifFalse:
[fileListTop _ 0].
window addMorph: (PluggableListMorph on: aFileList list: #fileList selected: #fileListIndex
changeSelected: #fileListIndex: menu: #fileListMenu:)
frame: (0.3 @ fileListTop corner: 1 at 0.3).
window addMorph: (PluggableTextMorph on: aFileList text: #contents accept: #put:
readSelection: #contentsSelection menu: #fileContentsMenu:shifted:)
frame: (0 at 0.3 corner: 1 at 1).
^ window! !
-------------- next part --------------
'From Squeak2.8alpha of 19 February 2000 [latest update: #2158] on 21 May 2000 at 8:51:00 pm'!
!FileList class methodsFor: 'instance creation' stamp: 'kfr 5/21/2000 20:39'!
openAsMorph
"Open a morphic view of a FileList on the default directory."
| dir aFileList window fileListTop |
dir _ FileDirectory default.
aFileList _ self new directory: dir.
window _ (SystemWindow labelled: dir pathName) model: aFileList.
window addMorph: ((PluggableListMorph on: aFileList list: #volumeList selected: #volumeListIndex
changeSelected: #volumeListIndex: menu: #volumeMenu:) autoDeselect: false)
layout: (Layout
leftFraction: 0 offset: 0
topFraction: 0 offset: 0
rightFraction: 0.3 offset: 0
bottomFraction: 0.3 offset: Preferences textRowHeight negated).
window addMorph: ((PluggableTextMorph on: aFileList text: #pattern accept: #pattern:)scrollBarHidden: true )
layout: (Layout
leftFraction: 0 offset: 0
topFraction: 0.3 offset: Preferences textRowHeight negated
rightFraction: 0.3 offset: 0
bottomFraction: 0.3 offset: 0).
Preferences optionalButtons
ifTrue:
[window addMorph: aFileList optionalButtonRow
layout: (Layout
leftFraction: 0.3 offset: 0
topFraction: 0 offset: 0
rightFraction: 1 offset: 0
bottomFraction: 0 offset: Preferences buttonRowHeight).
fileListTop _ Preferences buttonRowHeight]
ifFalse:
[fileListTop _ 0].
window addMorph: (PluggableListMorph on: aFileList list: #fileList selected: #fileListIndex
changeSelected: #fileListIndex: menu: #fileListMenu:)
layout: (Layout
leftFraction: 0.3 offset: 0
topFraction: 0 offset: fileListTop
rightFraction: 1 offset: 0
bottomFraction: 0.3 offset: 0).
window addMorph: (PluggableTextMorph on: aFileList text: #contents accept: #put:
readSelection: #contentsSelection menu: #fileContentsMenu:shifted:)
frame: (0 at 0.3 corner: 1 at 1).
^ window! !
More information about the Squeak-dev
mailing list
|