[squeak-dev] The Trunk: Morphic-dtl.323.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Feb 6 22:08:28 UTC 2010


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 at 0 corner: 0.4 at 0.5625).
+ 
+ 	templateMorph := PluggableTextMorph on: self
+ 		text: #pattern
+ 		accept: #pattern:.
+ 	templateMorph askBeforeDiscardingEdits: false.
+ 	windowMorph addMorph: templateMorph frame: (0 at 0.5625 corner: 0.4 at 0.75).
+ 
+ 	fileListMorph := PluggableListMorph on: self
+ 		list: #fileList
+ 		selected: #fileListIndex
+ 		changeSelected: #fileListIndex:
+ 		menu: #fileListMenu:.
+ 
+ 	windowMorph addMorph: fileListMorph frame: (0.4 at 0 corner: 1.0 at 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 at 0.75 corner: 0.25 at 1.0);
+ 		addMorph: middleButtonMorph frame: (0.25 at 0.75 corner: 0.75 at 1.0);
+ 		addMorph: rightButtonMorph frame: (0.75 at 0.75 corner: 1.0 at 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 at 0 extent: 80 at 45).
- 	topView addSubView: volListView.
- 
- 	templateView := PluggableTextView on: self
- 		text: #pattern
- 		accept: #pattern:.
- 	templateView askBeforeDiscardingEdits: false.
- 	templateView window: (0 at 0 extent: 80 at 15).
- 	topView addSubView: templateView below: volListView.
- 
- 	fileListView := PluggableListView on: self
- 		list: #fileList
- 		selected: #fileListIndex
- 		changeSelected: #fileListIndex:
- 		menu: #fileListMenu:.
- 	fileListView window: (0 at 0 extent: 120 at 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 at 0 extent: 200 at 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 at 0 extent: 50 at 15).
- 
- 	middleButtonView := PluggableButtonView
- 		on: self
- 		getState: nil
- 		action: nil.
- 	middleButtonView
- 		label: prompt;
- 		window: (0 at 0 extent: 100 at 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 at 0 extent: 50 at 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 at 0 corner: 0.4 at 0.5625).
- 
- 	templateMorph := PluggableTextMorph on: self
- 		text: #pattern
- 		accept: #pattern:.
- 	templateMorph askBeforeDiscardingEdits: false.
- 	windowMorph addMorph: templateMorph frame: (0 at 0.5625 corner: 0.4 at 0.75).
- 
- 	fileListMorph := PluggableListMorph on: self
- 		list: #fileList
- 		selected: #fileListIndex
- 		changeSelected: #fileListIndex:
- 		menu: #fileListMenu:.
- 
- 	windowMorph addMorph: fileListMorph frame: (0.4 at 0 corner: 1.0 at 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 at 0.75 corner: 0.25 at 1.0);
- 		addMorph: middleButtonMorph frame: (0.25 at 0.75 corner: 0.75 at 1.0);
- 		addMorph: rightButtonMorph frame: (0.75 at 0.75 corner: 1.0 at 1.0).
- 
- 	self changed: #getSelectionSel.
- 
-     windowMorph openInWorld: aWorld.
-     [windowMorph model notNil]
-        whileTrue: [aWorld doOneCycle].
-     ^self result
- !




More information about the Squeak-dev mailing list