![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | [TV52016061] Having two TTreeNodeShape in a TTree, if you add a connection between... | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | yeray alonso <yeray> |
| Component: | TTree | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | CONFIRMED --- | ||
| Severity: | enhancement | ||
| Priority: | High | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
Having two TTreeNodeShape in a TTree, if you add a connection between them, the parent is added to the childs' parents list, but the child isn't added to the parent's childs list. Demonstration: procedure TForm1.FormCreate(Sender: TObject); var i, j: Integer; begin Tree1.AddNewShape(TTreeNodeShape.Create(Self), 0, 0, 'Shape1', nil); Tree1.AddNewShape(TTreeNodeShape.Create(Self), 0, 0, 'Shape2', nil); Tree1[0].AddConnection(Tree1[1]); for i:=0 to Tree1.Shapes.Count-1 do begin for j:=0 to Tree1.Shape[i].Parents.Count-1 do ShowMessage(Tree1.Shape[i].Parents[j].SimpleText + ' is one of ' + Tree1.Shape[i].SimpleText + ' parents'); //this is executed once for j:=0 to Tree1.Shape[i].Children.Count-1 do ShowMessage(Tree1.Shape[i].Children[j].SimpleText + ' is one of ' + Tree1.Shape[i].SimpleText + ' childen'); //this is never executed end; end; Proposal: In the function InternalAddConnection in TeeTree.pas, Function TTreeNodeShape.InternalAddConnection(AToShape:TTreeNodeShape):TTreeConnection; Where says: FFromShape:=Self; FToShape:=AToShape; if Assigned(FToShape.FParents) then FToShape.FParents.Add(Self) // use Parents list else if Assigned(FToShape.IParents0) then FToShape.Parents.Add(Self) // force creating Parents list else FToShape.IParents0:=Self; // optimization: do not create Parents list We could add the following inmediatelly after the above: if Assigned(FFromShape.FChildren) then FFromShape.FChildren.Add(FToShape) // use Children list else FFromShape.Children.Add(FToShape); // force creating Children list [created:2012-03-01T17:13:34.000+01:00 reported by:yeray@steema.com reported in version:2011.04.41118 (TeeChart VCL)]