From 9502513b2dd6875d1173b234b4c51658b56cfbeb Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Mon, 19 Aug 2024 22:15:50 +0200 Subject: [PATCH] Made implementors of #transferFrom:event: add #shouldCopy from the TransferMorph to the SpDragAndDropTransfer. --- .../SpAbstractMorphicListAdapter.class.st | 1 + .../SpDragAndDropTransfer.class.st | 15 ++++++++++++++- .../SpMorphicTableAdapter.class.st | 1 + .../SpMorphicTreeTableAdapter.class.st | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st b/src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st index cbc7587d..5046732a 100644 --- a/src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st @@ -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 ] diff --git a/src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st b/src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st index 4d0da6bd..861d8657 100644 --- a/src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st +++ b/src/Spec2-Adapters-Morphic/SpDragAndDropTransfer.class.st @@ -2,7 +2,8 @@ Class { #name : 'SpDragAndDropTransfer', #superclass : 'Object', #instVars : [ - 'passenger' + 'passenger', + 'shouldCopy' ], #category : 'Spec2-Adapters-Morphic-Support', #package : 'Spec2-Adapters-Morphic', @@ -20,3 +21,15 @@ SpDragAndDropTransfer >> passenger: anObject [ passenger := anObject ] + +{ #category : 'accessing' } +SpDragAndDropTransfer >> shouldCopy [ + + ^ shouldCopy +] + +{ #category : 'accessing' } +SpDragAndDropTransfer >> shouldCopy: anObject [ + + shouldCopy := anObject +] diff --git a/src/Spec2-Adapters-Morphic/SpMorphicTableAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicTableAdapter.class.st index ba32458f..a5ed3726 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicTableAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicTableAdapter.class.st @@ -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 diff --git a/src/Spec2-Adapters-Morphic/SpMorphicTreeTableAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicTreeTableAdapter.class.st index 3c25a2af..1c0a0978 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicTreeTableAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicTreeTableAdapter.class.st @@ -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;