Forum > LCL

[Solved] TTreeNode has a property NodeEffect. How can it be used?


TTreeNode has a property NodeEffect of type TGraphicsDrawEffect. I would like to gray out some nodes and there is indeed an NodeEffect gdeDisabled.
However, using it (setting it at directly after the creation of that node) has no effect. At least on Lazarus/FPC 2.2.4 and MacOS.

How can the TTreeNode.NodeEffect be used?

Arguments of type TGraphicsDrawEffect can optionally be used when drawing images out of an ImageList. The LCL performs a simple image manipulation to show the image in some specific state, e.g. grayed when the image represents a disabled item (gedDisabled). Or sometimes toolbar or menu icons are increased in brightness when the mouse hovers over them.

So, when you set the NodeEffect of a tree node to gdeDisabled it will be grayed out.

The attached demo cycles through all effects for the selected node by clicking on the button.

Ah, you mentioned macOS... Could be that the node effects are not implemented for cocoa. I wrote and tested the demo project on Windows.

No - the NodeEffects are working in macOS. (But I noticed that the SelectedIndex always returns to -1...)

Thanks wp, your answer was very helpful!


[0] Message Index

Go to full version