David T. Lewis uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-dtl.323.mcz ==================== Summary ==================== Name: Morphic-dtl.323 Author: dtl Time: 6 February 2010, 5:07:00.927 pm UUID: c0305df3-b29c-43ce-8b4d-7ba16bb2451d Ancestors: Morphic-ar.322 Change PluggableFileList>>open to dispatch through Project to MVC and Morphic methods. Replace #openLabel: and #openAsMorphLable:inWorld: with#morphicOpenLable:in: and mvcOpenLabel:in: called through Project current. Note: A better solution is to implement proper ToolBuilder support for PluggableFileList. =============== Diff against Morphic-ar.322 =============== Item was changed: ----- Method: PluggableFileList>>open (in category 'initialize-release') ----- open + + ^ Project current + dispatchTo: self + addPrefixAndSend: #OpenLabel:in: + withArguments: { prompt . self currentWorld } + ! - Smalltalk isMorphic - ifTrue:[^self openAsMorphLabel: prompt inWorld: self currentWorld] - ifFalse: [^self openLabel: directory pathName]! Item was added: + ----- Method: PluggableFileList>>morphicOpenLabel:in: (in category '*Morphic-FileList') ----- + morphicOpenLabel: aString in: aWorld + "Open a view of an instance of me." + "PluggableFileList new morphicOpenLabel: 'foo' in: 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 removed: - ----- 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 removed: - ----- 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 - ! |
Free forum by Nabble | Edit this page |