[Lazarus] VirtualTreeView: Expand/Collapse without OnNodeClick

Jürgen Hestermann juergen.hestermann at gmx.de
Wed Sep 7 10:19:05 CEST 2016


Am 2016-09-07 um 06:32 schrieb Balázs Székely:
 >>> I am still wondering why this is needed at all...
 > TTreeView behaves the same. When you click on the +/- buttons is still
 > considered a node click, because technically you do click a node.

IMO this is not true.
I am not clicking on the node but on the button to the left of it.
When I click on expand/collapse, why should I want to trigger
any other function with this?
Also, as already written, when I use the internal functions
of VTV to let me *select* a node by clicking on it,
then this selection does not happen together with expand/collapse
(although in your logic I am clicking on the node too).
So why should NodeClick be fired?


 >>> So I have to again work around the workaround...
 > What exactly are you trying to achieve on NodeClick? Perhaps it can be
 > replaced with something else.

I have a (hierarchical) list of functions which
should be invoked when the user clicks on them.
But of course, arranging the tree of functions
by expanding/collapsing should not fire any of the
functions.

I have now a (new) workaround to my problem
so there is no need to look for an alternative solution.
Still I think that this behaviour of VTV is a bug.



More information about the Lazarus mailing list