Overriding double click on tree view?

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

Overriding double click on tree view?

rush
Hi,

is there a simple way (without messing with windows api) to override
behaviour of double click on tree view? Default is to expand/colapse the
tree, I would like to expand/colapse state to remain unchanged, but to do
some other things like change the icon.

rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/


Reply | Threaded
Open this post in threaded view
|

Re: Overriding double click on tree view?

Udo Schneider
rush wrote:
> is there a simple way (without messing with windows api) to override
> behaviour of double click on tree view? Default is to expand/colapse the
> tree, I would like to expand/colapse state to remain unchanged, but to do
> some other things like change the icon.

Create a subclass of Treeview and add the following:
MyTreeView>>onLeftButtonPressed: aMouseEvent
        "Default handler for a left button down mouse event.
        Do NOT accept the default window processing."

        self presenter trigger: #leftButtonPressed: with: aMouseEvent.
        ^1

You can either change the icon within this method or let the triggered
presenter decide what to do.

CU,

Udo


Reply | Threaded
Open this post in threaded view
|

Re: Overriding double click on tree view?

Udo Schneider
Udo Schneider wrote:
> MyTreeView>>onLeftButtonPressed: aMouseEvent
I should read first .. write later :-)

The method I described is for single clicks only. Overriding the
appropriate double click message should do the job.

CU,

Udo


Reply | Threaded
Open this post in threaded view
|

Re: Overriding double click on tree view?

rush
"Udo Schneider" <[hidden email]> wrote in message
news:TACWe.59040$[hidden email]...
> Udo Schneider wrote:
> > MyTreeView>>onLeftButtonPressed: aMouseEvent
> I should read first .. write later :-)
>
> The method I described is for single clicks only. Overriding the
> appropriate double click message should do the job.

Thanks! works like charm.

rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/