[Pkg] The Trunk: Morphic-cmm.383.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Nov 8 03:01:42 UTC 2011

Chris Muller uploaded a new version of Morphic to project The Trunk:

==================== Summary ====================

Name: Morphic-cmm.383
Author: cmm
Time: 16 March 2010, 10:42:11.077 am
UUID: 01c3eff2-e857-4b93-8898-4e144c375953
Ancestors: Morphic-cmm.382, Morphic-cmm.382

Merged Morphic-cmm.382 from the trunk (the one with Michael Davies enhancement).

=============== Diff against Morphic-cmm.382 ===============

Item was changed:
  ----- Method: MenuMorph>>addItem: (in category 'construction') -----
  addItem: aBlock
  	| item |
  	item := MenuItemMorph new.
  	aBlock value: item.
+ 	self addMenuItem: item!
- 	self addMorphBack: item!

Item was added:
+ ----- Method: MenuMorph>>addMenuItem: (in category 'construction') -----
+ addMenuItem: aMenuItemMorph
+ 	self addMorphBack: aMenuItemMorph!

Item was added:
+ ----- Method: Morph>>morphToDropInPasteUp: (in category 'dropping/grabbing') -----
+ morphToDropInPasteUp: aPasteUp
+ 	^ self!

Item was added:
+ ----- Method: PasteUpMorph>>hasTransferMorphConverter (in category 'dropping/grabbing') -----
+ hasTransferMorphConverter
+ 	^ self transferMorphConverter ~= #yourself!

Item was added:
+ ----- Method: PasteUpMorph>>morphToDropForTransferMorph: (in category 'dropping/grabbing') -----
+ morphToDropForTransferMorph: aTransferMorph 
+ 	"aTransferMorph has been dragged directly onto the desktop.  TransferMorphs, by nature, are about transferring a 'logical object' from another source. Answer the Morph that should actually be dropped on to the desktop."
+ 	^ self
+ 		perform: self transferMorphConverter
+ 		with: aTransferMorph!

Item was changed:
  ----- Method: PasteUpMorph>>morphToDropFrom: (in category 'dropping/grabbing') -----
  morphToDropFrom: aMorph 
  	"Given a morph being carried by the hand, which the hand is about to drop, answer the actual morph to be deposited.  Normally this would be just the morph itself, but several unusual cases arise, which this method is designed to service."
  	| aNail representee handy posBlock |
  	handy := self primaryHand.
  	posBlock := 
  			[:z | | tempPos | 
  			tempPos := handy position 
  						- ((handy targetOffset - aMorph formerPosition) 
  								* (z extent / aMorph extent)) rounded.
  			self pointFromWorld: tempPos].
  	self alwaysShowThumbnail 
  			[aNail := aMorph 
  						representativeNoTallerThan: self maxHeightToAvoidThumbnailing
  						norWiderThan: self maximumThumbnailWidth
  						thumbnailHeight: self heightForThumbnails.
  			aNail == aMorph 
  					[aMorph formerPosition: aMorph position.
  					aNail position: (posBlock value: aNail)].
  	((aMorph isKindOf: MorphThumbnail) 
  		and: [(representee := aMorph morphRepresented) owner isNil]) 
  				[representee position: (posBlock value: representee).
  	self showingListView 
  				listViewLineForFieldList: (self valueOfProperty: #fieldListSelectors)].
  	(aMorph hasProperty: #newPermanentScript) 
  		ifTrue: [^aMorph asEmptyPermanentScriptor].
  	((aMorph isPhraseTileMorph) or: [aMorph isSyntaxMorph]) 
+ 		ifFalse: [^aMorph morphToDropInPasteUp: self].
- 		ifFalse: [^aMorph].
  	aMorph userScriptSelector isEmptyOrNil 
  			self automaticPhraseExpansion ifFalse: [^aMorph]].
  	^aMorph morphToDropInPasteUp: self!

Item was added:
+ ----- Method: PasteUpMorph>>resetTransferMorphConverter (in category 'dropping/grabbing') -----
+ resetTransferMorphConverter
+ 	^ self transferMorphConverter: #yourself!

Item was added:
+ ----- Method: PasteUpMorph>>transferMorphConverter (in category 'dropping/grabbing') -----
+ transferMorphConverter
+ 	^self
+ 		valueOfProperty: #transferMorphConverter
+ 		ifAbsent: [ #yourself ]!

Item was added:
+ ----- Method: PasteUpMorph>>transferMorphConverter: (in category 'dropping/grabbing') -----
+ transferMorphConverter: aMessageSend 
+ 	self
+ 		setProperty: #transferMorphConverter
+ 		toValue: aMessageSend!

Item was changed:
  Morph subclass: #TransferMorph
+ 	instanceVariableNames: 'transferType passenger draggedMorph source dropNotifyRecipient resultRecipient copy'
- 	instanceVariableNames: 'transferType passenger draggedMorph source dropNotifyRecipient accepted resultRecipient copy'
  	classVariableNames: 'CopyPlusIcon'
  	poolDictionaries: ''
  	category: 'Morphic-Support'!
  !TransferMorph commentStamp: 'nk 6/16/2003 16:52' prior: 0!
  This is a Morph that is used to visually indicate the progress of a drag operation, and also as a container for various bits of drag state information.
  It polls the shift state in its step method to update its copy state (shift pressed = should copy).
  And if you hit the Escape key while dragging, it aborts the drag operation.!

Item was changed:
  ----- Method: TransferMorph>>delete (in category 'submorphs-add/remove') -----
  	"See also >>justDroppedInto:event:."
- 	accepted ifFalse: [self dropNotifyRecipient ifNotNil: [self dropNotifyRecipient dropRejectedMorph: self]].
  	self changed: #deleted.
  	self breakDependents.
  	super delete!

Item was changed:
  ----- Method: TransferMorph>>initialize (in category 'initialization') -----
  	"initialize the state of the receiver"
  	super initialize.
  	self layoutPolicy: TableLayout new.
  	self listDirection: #leftToRight;
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
  		layoutInset: 3;
  		wrapCentering: #center;
  		cellPositioning: #leftCenter.
- 	accepted := false.
  	copy := false.
  	self on: #keyStroke send: #keyStroke: to: self!

Item was changed:
  ----- Method: TransferMorph>>justDroppedInto:event: (in category 'dropping/grabbing') -----
  justDroppedInto: targetMorph event: anEvent 
  	"If only world wants this TransferMorph, treat it as unaccepted (see also >>delete)."
+ 	super
+ 		justDroppedInto: targetMorph
+ 		event: anEvent.
+ 	self animationForMoveSuccess: true.
- 	super justDroppedInto: targetMorph event: anEvent.
- 	accepted := targetMorph ~= self world.
- 	self animationForMoveSuccess: accepted.
- 	accepted ifTrue: [self dropNotifyRecipient ifNotNil: [self dropNotifyRecipient dropAcceptedMorph: self from: targetMorph]].
  	self delete!

Item was added:
+ ----- Method: TransferMorph>>morphToDropInPasteUp: (in category 'dropping/grabbing') -----
+ morphToDropInPasteUp: aPasteUpMorph
+ 	^ aPasteUpMorph morphToDropForTransferMorph: self!

Item was added:
+ ----- Method: TransferMorph>>wantsToBeDroppedInto: (in category 'dropping/grabbing') -----
+ wantsToBeDroppedInto: aMorph
+ 	^ aMorph isWorldMorph
+ 		ifTrue: [ aMorph hasTransferMorphConverter ]
+ 		ifFalse: [ super wantsToBeDroppedInto: aMorph ]!

More information about the Packages mailing list