DropContext.st
changeset 4126 1438e6fca79e
parent 2627 9f78995f7a33
child 4130 cc5749e7c679
equal deleted inserted replaced
4125:7d349e2afa0e 4126:1438e6fca79e
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1998 by eXept Software AG / Claus Gittinger
     4  COPYRIGHT (c) 1998 by eXept Software AG / Claus Gittinger
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
     8  be provided or otherwise made available to, or used by, any
    10  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    11  other person.  No title to or ownership of the software is
    10  hereby transferred.
    12  hereby transferred.
    11 "
    13 "
    12 "{ Package: 'stx:libview2' }"
    14 "{ Package: 'stx:libview2' }"
       
    15 
       
    16 "{ NameSpace: Smalltalk }"
    13 
    17 
    14 Object subclass:#DropContext
    18 Object subclass:#DropContext
    15 	instanceVariableNames:'dropObjects rootPoint dropSource sourceWidget dropTarget
    19 	instanceVariableNames:'dropObjects rootPoint dropSource sourceWidget dropTarget
    16 		targetWidget targetId hasDropped dragHandler manager dropInfo
    20 		targetWidget targetId hasDropped dragHandler manager dropInfo
    17 		dragType'
    21 		dragType'
   185     rootPoint isNil ifTrue:[^ nil].
   189     rootPoint isNil ifTrue:[^ nil].
   186 
   190 
   187     dev := sourceWidget device.
   191     dev := sourceWidget device.
   188     pnt := dev translatePoint:rootPoint from:(dev rootWindowId) to:targetId.
   192     pnt := dev translatePoint:rootPoint from:(dev rootWindowId) to:targetId.
   189 
   193 
   190     (pnt notNil and:[targetWidget notNil]) ifTrue:[
   194     "/ cg: why do you applyInverse below??
       
   195     "/ pnt is already coming in device coordinates from translatePoint:from:to: 
       
   196     "/ so the applyInverse is completely bogus !!!!!!
       
   197 
       
   198     false "(pnt notNil and:[targetWidget notNil])" ifTrue:[
   191         (trn := targetWidget transformation) notNil ifTrue:[
   199         (trn := targetWidget transformation) notNil ifTrue:[
   192             ^ trn applyInverseTo:pnt.
   200             ^ trn applyInverseTo:pnt.
   193         ].
   201         ].
   194         "/ ca: do not translate here - drop is in device coordinates EVERYWHERE
   202         "/ ca: do not translate here - drop is in device coordinates EVERYWHERE
   195         "/ (org := targetWidget viewOrigin) notNil ifTrue:[
   203         "/ (org := targetWidget viewOrigin) notNil ifTrue:[
   196         "/     ^ pnt + org.
   204         "/     ^ pnt + org.
   197         "/ ].
   205         "/ ].
   198     ].
   206     ].
       
   207     Transcript show:'targetPnt: '; showCR:pnt.
   199     ^ pnt
   208     ^ pnt
       
   209 
       
   210     "Modified: / 14-06-2018 / 11:07:37 / Claus Gittinger"
   200 !
   211 !
   201 
   212 
   202 targetWidget
   213 targetWidget
   203     "returns the widget assigned to the current dropTarget"
   214     "returns the widget assigned to the current dropTarget"
   204 
   215 
   390 ! !
   401 ! !
   391 
   402 
   392 !DropContext class methodsFor:'documentation'!
   403 !DropContext class methodsFor:'documentation'!
   393 
   404 
   394 version
   405 version
   395     ^ '$Header: /cvs/stx/stx/libview2/DropContext.st,v 1.17 2009-05-01 17:36:53 cg Exp $'
   406     ^ '$Header$'
   396 ! !
   407 ! !
       
   408