On Sat, 1 May 2010 17:42:09 +0300 Juha Manninen <[email protected]> wrote:
> 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. The easiest way would be a simple property NodeClass: TTreeNodeClass. For Delphi compatibility I added OnCreateNodeClass. Mattias -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
