1

My question relates to the issue raised in

TVirtualStringTree. How to check a node and its children with a single confirmation?

If the options for propagation are enabled and the user checks an internal node, the events OnCheck and OnChecking are triggered first for its child nodes. Is there any way that the program could identify the exact node checked by the user, when event handler for OnCheck is being executed? I experimentally ascertained that the handler for OnNodeClick is triggered only after OnCheck.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
Chris S
  • 151
  • 8

1 Answers1

0

There is nothing built in, you will need to do it yourself.

The OnChecking event for the clicked node seems to be the first one executed at a checkbox click. So, create a variable, say ClickedNode:PVirtualNode (normally nil). In the OnChecking event check if it is nil and if it is, set it's value to the node of the event. The last event to fire is the OnClick event, in which you reset the ClickedNode to nil. In between, in the OnChecking or OnChecked events, you know that ClickedNode triggered the checking sequence.

Tom Brunberg
  • 20,312
  • 8
  • 37
  • 54