Edgar J. De Cleene uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-edc.185.mcz ==================== Summary ==================== Name: Tools-edc.185 Author: edc Time: 18 February 2010, 8:01:09.498 am UUID: 8295901b-f6ed-4b45-baf1-4ce489d3cf1b Ancestors: Tools-cmm.184 Enhanced Filelist2 for populated disk. You could navigate and the last dir you use is remembered. See navigation for loading projects in dockingbar =============== Diff against Tools-cmm.184 =============== Item was changed: ----- Method: FileList2 class>>morphicViewFileSelectorForSuffixes: (in category 'morphic ui') ----- + morphicViewFileSelectorForSuffixes: aList - morphicViewFileSelectorForSuffixes: aList "Answer a morphic file-selector tool for the given suffix list." + ^ self morphicViewFileSelectorForSuffixes: aList directory: self modalFolderSelector! - - ^self - morphicViewFileSelectorForSuffixes: aList - directory: FileDirectory default.! Item was added: + ----- Method: PluggableFileList>>openAsMorphLabel:inWorld: (in category 'initialize-release') ----- + openAsMorphLabel: aString inWorld: aWorld + "Open a view of an instance of me." + "PluggableFileList new openAsMorphLabel: 'foo' inWorld: World" + | windowMorph volListMorph templateMorph fileListMorph leftButtonMorph middleButtonMorph rightButtonMorph | + + self directory: directory. + windowMorph := (SystemWindow labelled: aString) model: self. + + volListMorph := PluggableListMorph on: self + list: #volumeList + selected: #volumeListIndex + changeSelected: #volumeListIndex: + menu: #volumeMenu:. + volListMorph autoDeselect: false. + windowMorph addMorph: volListMorph frame: (0@0 corner: 0.4@0.5625). + + templateMorph := PluggableTextMorph on: self + text: #pattern + accept: #pattern:. + templateMorph askBeforeDiscardingEdits: false. + windowMorph addMorph: templateMorph frame: (0@0.5625 corner: 0.4@0.75). + + fileListMorph := PluggableListMorph on: self + list: #fileList + selected: #fileListIndex + changeSelected: #fileListIndex: + menu: #fileListMenu:. + + windowMorph addMorph: fileListMorph frame: (0.4@0 corner: 1.0@0.75). + + leftButtonMorph := PluggableButtonMorph + on: self + getState: #leftButtonState + action: #leftButtonPressed. + leftButtonMorph + hResizing: #spaceFill; + vResizing: #spaceFill; + label: 'Cancel'; + onColor: Color red offColor: Color red; + feedbackColor: Color orange; + borderWidth: 3. + + middleButtonMorph := PluggableButtonMorph + on: self + getState: nil + action: nil. + middleButtonMorph + hResizing: #spaceFill; + vResizing: #spaceFill; + label: prompt; + onColor: Color lightYellow offColor: Color lightYellow; + feedbackColor: Color lightYellow; + borderWidth: 1. + + rightButtonMorph := PluggableButtonMorph + on: self + getState: #rightButtonState + action: #rightButtonPressed. + rightButtonMorph + hResizing: #spaceFill; + vResizing: #spaceFill; + label: 'Accept'; + onColor: Color green offColor: Color lightYellow; + feedbackColor: Color black; + borderWidth: (self canAccept ifTrue: [3] ifFalse: [1]). + "self canAccept ifFalse: [rightButtonMorph controller: NoController new]." + + windowMorph + addMorph: leftButtonMorph frame: (0@0.75 corner: 0.25@1.0); + addMorph: middleButtonMorph frame: (0.25@0.75 corner: 0.75@1.0); + addMorph: rightButtonMorph frame: (0.75@0.75 corner: 1.0@1.0). + + self changed: #getSelectionSel. + + windowMorph openInWorld: aWorld. + [windowMorph model notNil] + whileTrue: [aWorld doOneCycle]. + ^self result + ! Item was added: + ----- Method: FileList2 class>>lastSelDir (in category 'accessing') ----- + lastSelDir + ^ lastSelDir! Item was changed: ----- Method: FileList2 class>>modalFolderSelector (in category 'modal dialogs') ----- modalFolderSelector + self lastSelDir ifNil: [^self modalFolderSelector: FileDirectory default] + ifNotNil:[^self modalFolderSelector: self lastSelDir ] + ! - - ^self modalFolderSelector: FileDirectory default! Item was added: + ----- Method: PluggableFileList>>openLabel: (in category 'initialize-release') ----- + openLabel: aString + "Open a view of an instance of me." + "StandardFileDialog new open" + | topView volListView templateView fileListView fileStringView leftButtonView middleButtonView rightButtonView | + + self directory: directory. + topView := (PluggableFileListView new) + model: self. + + volListView := PluggableListView on: self + list: #volumeList + selected: #volumeListIndex + changeSelected: #volumeListIndex: + menu: #volumeMenu:. + volListView autoDeselect: false. + volListView window: (0@0 extent: 80@45). + topView addSubView: volListView. + + templateView := PluggableTextView on: self + text: #pattern + accept: #pattern:. + templateView askBeforeDiscardingEdits: false. + templateView window: (0@0 extent: 80@15). + topView addSubView: templateView below: volListView. + + fileListView := PluggableListView on: self + list: #fileList + selected: #fileListIndex + changeSelected: #fileListIndex: + menu: #fileListMenu:. + fileListView window: (0@0 extent: 120@60). + + topView addSubView: fileListView toRightOf: volListView. + + fileListView controller terminateDuringSelect: true. "Pane to left may change under scrollbar" + + "fileStringView := PluggableTextView on: self + text: #fileString + accept: #fileString:. + fileStringView askBeforeDiscardingEdits: false. + fileStringView window: (0@0 extent: 200@15). + topView addSubView: fileStringView below: templateView." + fileStringView := templateView. + + + leftButtonView := PluggableButtonView + on: self + getState: nil + action: #leftButtonPressed. + leftButtonView + label: 'Cancel'; + backgroundColor: Color red; + borderWidth: 3; + window: (0@0 extent: 50@15). + + middleButtonView := PluggableButtonView + on: self + getState: nil + action: nil. + middleButtonView + label: prompt; + window: (0@0 extent: 100@15); + borderWidth: 1; + controller: NoController new. + + rightButtonView := PluggableButtonView + on: self + getState: nil + action: #rightButtonPressed. + rightButtonView + label: 'Accept'; + backgroundColor: (self canAccept ifTrue: [Color green] ifFalse: [Color lightYellow]); + borderWidth: (self canAccept ifTrue: [3] ifFalse: [1]); + window: (0@0 extent: 50@15). + self canAccept ifFalse: [rightButtonView controller: NoController new]. + + topView acceptButtonView: rightButtonView. + + topView + addSubView: leftButtonView below: fileStringView; + addSubView: middleButtonView toRightOf: leftButtonView; + addSubView: rightButtonView toRightOf: middleButtonView. + + self changed: #getSelectionSel. + topView doModalDialog. + + ^self result + ! Item was changed: ----- Method: FileList2 class>>modalFolderSelector: (in category 'modal dialogs') ----- modalFolderSelector: aDir | window fileModel | + window _ self morphicViewFolderSelector: aDir. + fileModel _ window model. - window := self morphicViewFolderSelector: aDir. - fileModel := window model. window openInWorld: self currentWorld extent: 300@400. self modalLoopOn: window. + ^self lastSelDir: fileModel getSelectedDirectory withoutListWrapper! - ^fileModel getSelectedDirectory withoutListWrapper! Item was added: + ----- Method: FileList2 class>>lastSelDir: (in category 'accessing') ----- + lastSelDir: aDir + ^ lastSelDir := aDir! |
Hi Edgar,
This looks good. I did an update (Tools-dtl.186) to remove two methods with Morphic/MVC dependencies that are not needed any more. Please let me know if this causes any problems. The methods that I removed are #openAsMorphLabel:inWorld: and #openLabel:. Thanks, Dave On Thu, Feb 18, 2010 at 10:56:42AM +0000, [hidden email] wrote: > Edgar J. De Cleene uploaded a new version of Tools to project The Trunk: > http://source.squeak.org/trunk/Tools-edc.185.mcz > > ==================== Summary ==================== > > Name: Tools-edc.185 > Author: edc > Time: 18 February 2010, 8:01:09.498 am > UUID: 8295901b-f6ed-4b45-baf1-4ce489d3cf1b > Ancestors: Tools-cmm.184 > > Enhanced Filelist2 for populated disk. > You could navigate and the last dir you use is remembered. > See navigation for loading projects in dockingbar > > =============== Diff against Tools-cmm.184 =============== |
In reply to this post by commits-2
On Thu, 18 Feb 2010, [hidden email] wrote:
> Edgar J. De Cleene uploaded a new version of Tools to project The Trunk: > http://source.squeak.org/trunk/Tools-edc.185.mcz > > ==================== Summary ==================== > > Name: Tools-edc.185 > Author: edc > Time: 18 February 2010, 8:01:09.498 am > UUID: 8295901b-f6ed-4b45-baf1-4ce489d3cf1b > Ancestors: Tools-cmm.184 > > Enhanced Filelist2 for populated disk. > You could navigate and the last dir you use is remembered. This doesn't work as it should. FileList2 class >> #morphicViewFileSelector opens a modal folder selector which it shouldn't. If you run all tests, you'll notice the dialogs popping, this it not ok. Also the file selector doesn't store the last used directory, only the directory selector does. Levente > See navigation for loading projects in dockingbar > > =============== Diff against Tools-cmm.184 =============== > > Item was changed: > ----- Method: FileList2 class>>morphicViewFileSelectorForSuffixes: (in category 'morphic ui') ----- > + morphicViewFileSelectorForSuffixes: aList > - morphicViewFileSelectorForSuffixes: aList > "Answer a morphic file-selector tool for the given suffix list." > + ^ self morphicViewFileSelectorForSuffixes: aList directory: self modalFolderSelector! > - > - ^self > - morphicViewFileSelectorForSuffixes: aList > - directory: FileDirectory default.! > > Item was added: > + ----- Method: PluggableFileList>>openAsMorphLabel:inWorld: (in category 'initialize-release') ----- > + openAsMorphLabel: aString inWorld: aWorld > + "Open a view of an instance of me." > + "PluggableFileList new openAsMorphLabel: 'foo' inWorld: World" > + | windowMorph volListMorph templateMorph fileListMorph leftButtonMorph middleButtonMorph rightButtonMorph | > + > + self directory: directory. > + windowMorph := (SystemWindow labelled: aString) model: self. > + > + volListMorph := PluggableListMorph on: self > + list: #volumeList > + selected: #volumeListIndex > + changeSelected: #volumeListIndex: > + menu: #volumeMenu:. > + volListMorph autoDeselect: false. > + windowMorph addMorph: volListMorph frame: (0@0 corner: 0.4@0.5625). > + > + templateMorph := PluggableTextMorph on: self > + text: #pattern > + accept: #pattern:. > + templateMorph askBeforeDiscardingEdits: false. > + windowMorph addMorph: templateMorph frame: (0@0.5625 corner: 0.4@0.75). > + > + fileListMorph := PluggableListMorph on: self > + list: #fileList > + selected: #fileListIndex > + changeSelected: #fileListIndex: > + menu: #fileListMenu:. > + > + windowMorph addMorph: fileListMorph frame: (0.4@0 corner: 1.0@0.75). > + > + leftButtonMorph := PluggableButtonMorph > + on: self > + getState: #leftButtonState > + action: #leftButtonPressed. > + leftButtonMorph > + hResizing: #spaceFill; > + vResizing: #spaceFill; > + label: 'Cancel'; > + onColor: Color red offColor: Color red; > + feedbackColor: Color orange; > + borderWidth: 3. > + > + middleButtonMorph := PluggableButtonMorph > + on: self > + getState: nil > + action: nil. > + middleButtonMorph > + hResizing: #spaceFill; > + vResizing: #spaceFill; > + label: prompt; > + onColor: Color lightYellow offColor: Color lightYellow; > + feedbackColor: Color lightYellow; > + borderWidth: 1. > + > + rightButtonMorph := PluggableButtonMorph > + on: self > + getState: #rightButtonState > + action: #rightButtonPressed. > + rightButtonMorph > + hResizing: #spaceFill; > + vResizing: #spaceFill; > + label: 'Accept'; > + onColor: Color green offColor: Color lightYellow; > + feedbackColor: Color black; > + borderWidth: (self canAccept ifTrue: [3] ifFalse: [1]). > + "self canAccept ifFalse: [rightButtonMorph controller: NoController new]." > + > + windowMorph > + addMorph: leftButtonMorph frame: (0@0.75 corner: 0.25@1.0); > + addMorph: middleButtonMorph frame: (0.25@0.75 corner: 0.75@1.0); > + addMorph: rightButtonMorph frame: (0.75@0.75 corner: 1.0@1.0). > + > + self changed: #getSelectionSel. > + > + windowMorph openInWorld: aWorld. > + [windowMorph model notNil] > + whileTrue: [aWorld doOneCycle]. > + ^self result > + ! > > Item was added: > + ----- Method: FileList2 class>>lastSelDir (in category 'accessing') ----- > + lastSelDir > + ^ lastSelDir! > > Item was changed: > ----- Method: FileList2 class>>modalFolderSelector (in category 'modal dialogs') ----- > modalFolderSelector > + self lastSelDir ifNil: [^self modalFolderSelector: FileDirectory default] > + ifNotNil:[^self modalFolderSelector: self lastSelDir ] > + ! > - > - ^self modalFolderSelector: FileDirectory default! > > Item was added: > + ----- Method: PluggableFileList>>openLabel: (in category 'initialize-release') ----- > + openLabel: aString > + "Open a view of an instance of me." > + "StandardFileDialog new open" > + | topView volListView templateView fileListView fileStringView leftButtonView middleButtonView rightButtonView | > + > + self directory: directory. > + topView := (PluggableFileListView new) > + model: self. > + > + volListView := PluggableListView on: self > + list: #volumeList > + selected: #volumeListIndex > + changeSelected: #volumeListIndex: > + menu: #volumeMenu:. > + volListView autoDeselect: false. > + volListView window: (0@0 extent: 80@45). > + topView addSubView: volListView. > + > + templateView := PluggableTextView on: self > + text: #pattern > + accept: #pattern:. > + templateView askBeforeDiscardingEdits: false. > + templateView window: (0@0 extent: 80@15). > + topView addSubView: templateView below: volListView. > + > + fileListView := PluggableListView on: self > + list: #fileList > + selected: #fileListIndex > + changeSelected: #fileListIndex: > + menu: #fileListMenu:. > + fileListView window: (0@0 extent: 120@60). > + > + topView addSubView: fileListView toRightOf: volListView. > + > + fileListView controller terminateDuringSelect: true. "Pane to left may change under scrollbar" > + > + "fileStringView := PluggableTextView on: self > + text: #fileString > + accept: #fileString:. > + fileStringView askBeforeDiscardingEdits: false. > + fileStringView window: (0@0 extent: 200@15). > + topView addSubView: fileStringView below: templateView." > + fileStringView := templateView. > + > + > + leftButtonView := PluggableButtonView > + on: self > + getState: nil > + action: #leftButtonPressed. > + leftButtonView > + label: 'Cancel'; > + backgroundColor: Color red; > + borderWidth: 3; > + window: (0@0 extent: 50@15). > + > + middleButtonView := PluggableButtonView > + on: self > + getState: nil > + action: nil. > + middleButtonView > + label: prompt; > + window: (0@0 extent: 100@15); > + borderWidth: 1; > + controller: NoController new. > + > + rightButtonView := PluggableButtonView > + on: self > + getState: nil > + action: #rightButtonPressed. > + rightButtonView > + label: 'Accept'; > + backgroundColor: (self canAccept ifTrue: [Color green] ifFalse: [Color lightYellow]); > + borderWidth: (self canAccept ifTrue: [3] ifFalse: [1]); > + window: (0@0 extent: 50@15). > + self canAccept ifFalse: [rightButtonView controller: NoController new]. > + > + topView acceptButtonView: rightButtonView. > + > + topView > + addSubView: leftButtonView below: fileStringView; > + addSubView: middleButtonView toRightOf: leftButtonView; > + addSubView: rightButtonView toRightOf: middleButtonView. > + > + self changed: #getSelectionSel. > + topView doModalDialog. > + > + ^self result > + ! > > Item was changed: > ----- Method: FileList2 class>>modalFolderSelector: (in category 'modal dialogs') ----- > modalFolderSelector: aDir > > | window fileModel | > + window _ self morphicViewFolderSelector: aDir. > + fileModel _ window model. > - window := self morphicViewFolderSelector: aDir. > - fileModel := window model. > window openInWorld: self currentWorld extent: 300@400. > self modalLoopOn: window. > + ^self lastSelDir: fileModel getSelectedDirectory withoutListWrapper! > - ^fileModel getSelectedDirectory withoutListWrapper! > > Item was added: > + ----- Method: FileList2 class>>lastSelDir: (in category 'accessing') ----- > + lastSelDir: aDir > + ^ lastSelDir := aDir! > > > |
On 2/20/10 7:22 PM, "Levente Uzonyi" <[hidden email]> wrote: > This doesn't work as it should. FileList2 class >> #morphicViewFileSelector > opens a modal folder selector which it shouldn't. If you run all tests, > you'll notice the dialogs popping, this it not ok. Also the file selector > doesn't store the last used directory, only the directory selector does. morphicViewFileSelector RAA 3/6/2001 12:47 FileList2 class morphicViewFileSelector {morphic ui}' Change and summit. |
Free forum by Nabble | Edit this page |