[Lazarus] TTreeView events OnCreateNodeClass and OnAddition

Mattias Gaertner nc-gaertnma at netcologne.de
Sun May 2 00:29:49 CEST 2010


On Sun, 2 May 2010 00:13:47 +0200
José Mejuto <joshyfun at gmail.com> wrote:

> Hello Lazarus-List,
> 
> Saturday, May 1, 2010, 6:50:52 PM, you wrote:
> 
> MG> It is just my humble opinion that instead of adding a published event
> MG> property it would be simpler to have a property NodeClass:
> MG> TTreeNodeClass.
> MG> But since Delphi already defined an event, we use the event. So no need
> MG> for a simple property.
> 
> IMHO if you have a simple property it would be quite complex to use
> different TreeNode types in the same TreeView, just like a TreeView
> with files and folders, each one with its derived TreeNode class.

TV.NodeClass:=TFileTreeNode;
TV.Items.Add(nil,'');
TV.NodeClass:=TDirectoryTreeNode;
TV.Items.Add(nil,'');

Does not look complicated to me.

Mattias





More information about the Lazarus mailing list