checkin from browser
authorClaus Gittinger <cg@exept.de>
Sun, 06 Apr 1997 15:03:43 +0200
changeset 515 7df33af3beaa
parent 514 6b18ed409057
child 516 76ffe180cff8
checkin from browser
DragAndDropManager.st
--- a/DragAndDropManager.st	Sat Apr 05 11:27:54 1997 +0200
+++ b/DragAndDropManager.st	Sun Apr 06 15:03:43 1997 +0200
@@ -7,7 +7,7 @@
 	category:'Interface-Support'
 !
 
-View subclass:#DemoView
+View subclass:#DemoView2
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
@@ -21,7 +21,7 @@
 	privateIn:DragAndDropManager
 !
 
-View subclass:#DemoView2
+View subclass:#DemoView
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
@@ -108,7 +108,10 @@
 !DragAndDropManager methodsFor:'dragging - generic'!
 
 doGenericDragX:x y:y
-    |view|
+    "drag to x/y; see if the target view allows a drop
+     and change the mouse pointer as appropriate"
+
+    |view newCursor|
 
     previousPoint notNil ifTrue:[
         opaque ifTrue:[
@@ -122,16 +125,17 @@
     view := self destinationViewAt:previousPoint.
     view ~~ lastView ifTrue:[
         view isNil ifTrue:[
-            "/ alien view
-            dragView cursor:(Cursor questionMark) now:true
+            "/ alien view - dont know if it likes a drop
+            newCursor := Cursor questionMark
         ] ifFalse:[
-            "/ ST/X view
+            "/ ST/X view - ask it.
             (view canDrop:dropObjects) ifTrue:[
-                dragView cursor:(Cursor thumbsUp) now:true.
+                newCursor := Cursor thumbsUp
             ] ifFalse:[
-                dragView cursor:(Cursor thumbsDown) now:true
+                newCursor := Cursor thumbsDown
             ]
         ].
+        dragView cursor:newCursor now:true.
         lastView := view
     ].
 
@@ -140,6 +144,8 @@
     ] ifFalse:[
         self invertGenericAt:previousPoint
     ].
+
+    "Modified: 6.4.1997 / 14:29:44 / cg"
 !
 
 drawGenericAt:ip
@@ -692,6 +698,42 @@
     "
 ! !
 
+!DragAndDropManager::DemoView2 methodsFor:'events'!
+
+buttonPress:button x:x y:y
+    DragAndDropManager new
+        startGenericDrag:[:p :v | v displayString:'hello' at:p]
+        in:self 
+        at:(x@y) 
+        atEnd:[:view
+               :viewID
+               :rootPoint
+               :viewPoint | ]
+
+
+    "
+     self new open
+    "
+
+
+! !
+
+!DragAndDropManager::DemoView3 methodsFor:'events'!
+
+buttonPress:button x:x y:y
+    DragAndDropManager new
+        startArrowDragIn:self 
+        at:(x@y)
+        atEnd:[:view
+               :viewID
+               :rootPoint
+               :viewPoint | ]
+
+    "
+     self new open
+    "
+! !
+
 !DragAndDropManager::DemoView methodsFor:'events'!
 
 buttonPress:button x:x y:y
@@ -718,44 +760,8 @@
     "
 ! !
 
-!DragAndDropManager::DemoView3 methodsFor:'events'!
-
-buttonPress:button x:x y:y
-    DragAndDropManager new
-        startArrowDragIn:self 
-        at:(x@y)
-        atEnd:[:view
-               :viewID
-               :rootPoint
-               :viewPoint | ]
-
-    "
-     self new open
-    "
-! !
-
-!DragAndDropManager::DemoView2 methodsFor:'events'!
-
-buttonPress:button x:x y:y
-    DragAndDropManager new
-        startGenericDrag:[:p :v | v displayString:'hello' at:p]
-        in:self 
-        at:(x@y) 
-        atEnd:[:view
-               :viewID
-               :rootPoint
-               :viewPoint | ]
-
-
-    "
-     self new open
-    "
-
-
-! !
-
 !DragAndDropManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.11 1997-04-04 23:59:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.12 1997-04-06 13:03:43 cg Exp $'
 ! !