Issue 6727 in pharo: DropFile event position is really strange

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 6727 in pharo: DropFile event position is really strange

pharo
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=6727

DropZone 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
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6727 in pharo: DropFile event position is really strange

pharo
Updates:
        Status: Integrated

Comment #1 on issue 6727 by [hidden email]: DropFile event position is  
really strange
http://code.google.com/p/pharo/issues/detail?id=6727

it will be there in next vm build


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker