Skip to content

Commit

Permalink
Merge pull request #1588 from Rinzwind/dragdroptransfer-shouldcopy
Browse files Browse the repository at this point in the history
Make implementors of #transferFrom:event: add #shouldCopy from the TransferMorph to the SpDragAndDropTransfer
  • Loading branch information
Ducasse authored Sep 11, 2024
2 parents d4afe08 + 9502513 commit 0c0d08a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ SpAbstractMorphicListAdapter >> transferFrom: aTransferMorph event: anEvent [
rowAndColumn := self widget container rowAndColumnIndexContainingPoint: anEvent position.
^ SpDragAndDropTransferToList new
passenger: aTransferMorph passenger;
shouldCopy: aTransferMorph shouldCopy;
index: (rowAndColumn first ifNil: [ 0 ]);
yourself
]
Expand Down
15 changes: 14 additions & 1 deletion src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Class {
#name : 'SpDragAndDropTransfer',
#superclass : 'Object',
#instVars : [
'passenger'
'passenger',
'shouldCopy'
],
#category : 'Spec2-Adapters-Morphic-Support',
#package : 'Spec2-Adapters-Morphic',
Expand All @@ -20,3 +21,15 @@ SpDragAndDropTransfer >> passenger: anObject [

passenger := anObject
]

{ #category : 'accessing' }
SpDragAndDropTransfer >> shouldCopy [

^ shouldCopy
]

{ #category : 'accessing' }
SpDragAndDropTransfer >> shouldCopy: anObject [

shouldCopy := anObject
]
1 change: 1 addition & 0 deletions src/Spec2-Adapters-Morphic/SpMorphicTableAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ SpMorphicTableAdapter >> transferFrom: aTransferMorph event: anEvent [
rowAndColumn := self widget container rowAndColumnIndexContainingPoint: anEvent position.
^ SpDragAndDropTransferToTable new
passenger: aTransferMorph passenger;
shouldCopy: aTransferMorph shouldCopy;
row: (rowAndColumn first ifNil: [ 0 ]);
column: (rowAndColumn second ifNil: [ 0 ]);
yourself
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ SpMorphicTreeTableAdapter >> transferFrom: aTransferMorph event: anEvent [

^ SpDragAndDropTransferToTree new
passenger: aTransferMorph passenger;
shouldCopy: aTransferMorph shouldCopy;
row: (rowAndColumn first ifNil: [ 0 ]);
column: (rowAndColumn second ifNil: [ 0 ]);
target: aTarget;
Expand Down

0 comments on commit 0c0d08a

Please sign in to comment.