About TreeView event(#leftButtonReleased:)

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

About TreeView event(#leftButtonReleased:)

Takeya Suzuki
Hi,

The next code was written.
--------------------------------
MyShell>>createSchematicWiring
super createSchematicWiring.
treePresenter when: #leftButtonReleased: send: #onLeftButtonRelease: to:
self.

MyShell>>onLeftButtonReleased: aMouseEvent
 MessageBox warning: 'test'.
--------------------------------

This event occurs at the time of double-clicking.

Doesn't it occur at the time of single clicking?

Regards

Takeya Suzuki


Reply | Threaded
Open this post in threaded view
|

Re: About TreeView event(#leftButtonReleased:)

Blair McGlashan
Takeya Suzuki

You wrote in message news:9s791h$115cb7$[hidden email]...

> Hi,
>
> The next code was written.
> --------------------------------
> MyShell>>createSchematicWiring
> super createSchematicWiring.
> treePresenter when: #leftButtonReleased: send: #onLeftButtonRelease: to:
> self.
>
> MyShell>>onLeftButtonReleased: aMouseEvent
>  MessageBox warning: 'test'.
> --------------------------------
>
> This event occurs at the time of double-clicking.
>
> Doesn't it occur at the time of single clicking?

It appears one only gets the 'mouse up' event when clicking over an area of
the tree other than one of the labels (I inserted a low-level event handler
method for WM_LBUTTONUP, namely #wmLButtonUp:wParam:lParam:, into the
TreeView class to investigate this). When one clicks over one of the labels
the TreeView control appears to absorbed the WM_LBUTTONDOWN in some way, and
consequently a WM_LBUTTONUP is never received. This is probably  because it
uses the click to initiate a drag operation, and if it is calling the Win32
DragDetect() API then that works by capturing the mouse and starting a modal
message loop until the mouse is released. DragDetect() absorbs all mouse
events up to and including the mouse up event.
Note thought that since Dolphin has subclassed the control it receives the
button down event before the control, therefore you could implement your own
selection management and drag detection, etc, but be warned that you will be
"swimming against the tide".

Regards

Blair