--- a/DropSource.st Sat Jul 03 19:11:48 2004 +0200
+++ b/DropSource.st Tue Jul 06 12:58:55 2004 +0200
@@ -135,8 +135,7 @@
displayObjectSelector isNil ifTrue:[
^ nil
].
- ^ displayObjectSelector numArgs == 0 ifTrue:[receiver perform:displayObjectSelector]
- ifFalse:[receiver perform:displayObjectSelector with:self]
+ ^ receiver perform:displayObjectSelector withOptionalArgument:self
!
dropObjects
@@ -146,8 +145,7 @@
^ nil
].
- ^ dropObjectSelector numArgs == 0 ifTrue:[receiver perform:dropObjectSelector]
- ifFalse:[receiver perform:dropObjectSelector with:self]
+ ^ receiver perform:dropObjectSelector withOptionalArgument:self
!
receiver
@@ -165,58 +163,58 @@
!DropSource methodsFor:'accessing-selectors'!
displayObjectSelector
- "selector to access the displayObjects; a sequence of String, Text, Icon or Image,
- LabelAndIcon ...
- If an argument is required, the argument is the dropSource (self)
- "
+ "selector to access the displayObjects; a sequence of String, Text, Icon or Image, LabelAndIcon ...
+ If the selector is for a one-arg message, the argument will be the dropSource (self)"
+
^ displayObjectSelector
!
displayObjectSelector:aSelectorWithNoneOrOneArgs
- "selector to access the displayObjects; a sequence of String, Text, Icon or Image,
- LabelAndIcon ...
- If an argument is required, the argument is the dropSource (self)
- "
+ "selector to access the displayObjects; a sequence of String, Text, Icon or Image, LabelAndIcon ...
+ If the selector is for a 1-arg message, the argument will be the dropSource (self)"
+
displayObjectSelector := aSelectorWithNoneOrOneArgs.
!
dropFeedBackSelector
- "selector called at end of a drop to give a feedback; the argument to
- the selector is the dropContext"
+ "selector of a 1-arg message sent at end of a drop operation (to give a feedback);
+ the argument to the message is the dropContext"
^ dropFeedBackSelector
!
dropFeedBackSelector:aSelectorWithZeroOrOneArgs
- "selector called at end of a drop to give a feedback; the argument to
- the selector is the dropContext"
+ "selector of a 1-arg message sent at end of a drop operation (to give a feedback);
+ the argument to the message is the dropContext"
dropFeedBackSelector := aSelectorWithZeroOrOneArgs.
!
dropObjectSelector
- "selector to access the draggable objects; a sequence of DropObject's
- If an argument is required, the argument is the dropSource (self)
- "
+ "selector to access the draggable objects; a sequence of DropObjects.
+ If the selector is for a 1-arg message, the argument will be the dropSource (self)"
+
^ dropObjectSelector
!
dropObjectSelector:aSelectorWithNoneOrOneArgs
- "selector to access the draggable objects; a sequence of DropObject's
- If an argument is required, the argument is the dropSource (self)
- "
+ "selector to access the draggable objects; a sequence of DropObjects.
+ If the selector is for a 1-arg message, the argument will be the dropSource (self)"
+
dropObjectSelector := aSelectorWithNoneOrOneArgs.
!
startDragSelector
- "send to the receiver to start a DragAndDropManager. If no selector is specified,
- the default drag & drop operation is performed.
+ "send to the receiver to start a DragAndDropManager.
+ If no selector is specified, the default drag & drop operation is performed.
Thus the operator is able to set the cursor, .... before starting the operation.
- the arguments to the selector are:
- 2 aDropSource (self) Widget
- 3 aDropSource (self) Widget Point
+ the (optional) arguments to the message are:
+ 1 dropSource (self)
+ 2 dropSource (self) Widget
+ 3 dropSource (self) Widget Point
"
+
^ startDragSelector
!
@@ -225,9 +223,10 @@
the default drag & drop operation is performed.
Thus the operator is able to set the cursor, .... before starting the operation.
- the arguments to the selector are:
- 2 aDropSource (self) Widget
- 3 aDropSource (self) Widget Point
+ the (optional) arguments to the message are:
+ 1 dropSource (self)
+ 2 dropSource (self) Widget
+ 3 dropSource (self) Widget Point
"
startDragSelector := aTwoOrThreeArgSelector
@@ -246,20 +245,16 @@
!
startDragIn:aView at:aPoint
- "start drag operation for a widget
- "
- |args|
+ "start drag operation for a widget"
startDragSelector notNil ifTrue:[
- args := startDragSelector numArgs.
- args == 2 ifTrue:[ ^ receiver perform:startDragSelector with:self with:aView ].
- args == 3 ifTrue:[ ^ receiver perform:startDragSelector with:self with:aView with:aPoint ].
+ ^ receiver perform:startDragSelector withOptionalArgument:self and:aView and:aPoint
].
+
"/
"/ the default
"/
DragAndDropManager startDragFrom:aView dropSource:self
-
! !
!DropSource methodsFor:'instance creation'!
@@ -293,5 +288,5 @@
!DropSource class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/DropSource.st,v 1.4 2003-03-30 13:07:42 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/DropSource.st,v 1.5 2004-07-06 10:58:55 cg Exp $'
! !