Strange Code in MenuComposerView onLeftButtonPressed:

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

Strange Code in MenuComposerView onLeftButtonPressed:

Christoph J. Bachinger
Hi OA,

scroll down method and find code which will never reached.

onLeftButtonPressed: aMouseEvent
        "Default handler for a mouse left button click event.
        Answer zero to suppress default processing."

        | arena |
        ^super onLeftButtonPressed: aMouseEvent.

        "
        index := self itemAt: aMouseEvent position.
        index == 0 ifTrue: [^0].
        arena := self creationParentView.
        arena onItemIn: self selectedAtIndex: index.
        self setFocus.
        (InternalDragDropSession dragSource: arena item: (self menu itemAt: index))
                imageAt: #Object put: (self createDragImage: aMouseEvent position);
                doDragDropAt: aMouseEvent position button: aMouseEvent button.

        "
        (MouseTracker forPresenter: arena presenter startingAt: aMouseEvent
screenPosition)
                origin: aMouseEvent position + self position;
                startTracking: arena.
        ^false
regrads
cjb


Reply | Threaded
Open this post in threaded view
|

Re: Strange Code in MenuComposerView onLeftButtonPressed:

Blair McGlashan-3
"Christoph J. Bachinger" <[hidden email]> wrote in message
news:[hidden email]...
> Hi OA,
>
> scroll down method and find code which will never reached.
>
> onLeftButtonPressed: aMouseEvent
>.... snip ....

It's just a left over from a restructuring of the drag & drop code in the
MenuComposer. The method should have been deleted, and I note that it has
been removed in D6, and will be removed by the next patch level.

Thanks

Blair