Andrew Haines wrote:
> > Delphi compatibility issue again. TTreeView is missing events:
> >   TTreeView.OnCreateNodeClass and 
> 
> LCL has TTreeView.OnCustomCreateItem which may do what you want for this

Now this may be a stupid question but what is the easiest way to use node 
class derived from TTreeNode, instead of TTreeNode itself?

In the program I try to port there is:

  TViewNode = class(TTreeNode)
  ...

Then OnCreateNodeClass handler is used only to indicate the node class type:

  procedure TTreeViewIntegrator.tvModelCreateNodeClass(
    Sender:   TCustomTreeView; var NodeClass: TTreeNodeClass);
  begin
    NodeClass := TViewNode;
  end;


In OnCustomCreateItem handler I would need to actually create the node and 
take care of owner and parent or siblings or whatever.


Regards,
Juha

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to