Status: Accepted
Owner:
[hidden email]
CC:
[hidden email]
Labels: Type-Bug Milestone-2.0
New issue 6727 by
[hidden email]: DropFile event position is really
strange
http://code.google.com/p/pharo/issues/detail?id=6727DropZone new openInWorld
Put the Morph on the top left corner
Then redefine this method:
dispatchDefault: anEvent with: aMorph
"Dispatch the given event. The event will be passed to the front-most
visible submorph that contains the position wrt. to the event."
| localEvt index child morphs inside |
"See if we're fully outside aMorphs bounds"
(anEvent class = DropFilesEvent ) and: [(aMorph class = DropZone) ifTrue:
[self halt]].
(aMorph fullBounds containsPoint: anEvent position)
ifFalse:[^#rejected]. "outside"
"Traverse children"
index := 1.
morphs := aMorph submorphs.
inside := false.
[index <= morphs size] whileTrue:[
child := morphs at: index.
localEvt := anEvent transformedBy: (child transformedFrom: aMorph).
(child processEvent: localEvt using: self) == #rejected ifFalse:[
"Not rejected. The event was in some submorph of the receiver"
inside := true.
localEvt wasHandled ifTrue:[anEvent copyHandlerState: localEvt].
index := morphs size. "break"
].
index := index + 1.
].
"Check for being inside the receiver"
inside ifFalse:[inside := aMorph containsPoint: anEvent position event:
anEvent].
inside ifTrue:[^aMorph handleEvent: anEvent].
^#rejected
Drop any file on the morph: its y will be around 800 and the raw vm event
has this value.
Esteban I would like to sit with you to investigate it.
Attachments:
DragAndDrop.st 553 bytes
_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker