1

Topic: Inheritance TGanttSeries

The task: to each dumbbell at TGanttSeries to add a certain internal object with which the user will interact.
Looked at source codes and saw that the most correct way - to add in Series. ValuesList the TChartValueList in which and to store the objects.
The problem in that TChartValueList is not so adjusted for inheritance half of necessary methods is declared not virtual,
[spoiler]

Function AddChartValue:Integer; overload;
Function AddChartValue (Const AValue:TChartValue):Integer; overload;>>> virtual; <<<
Function TChartValueList. AddChartValue (Const AValue:TChartValue):Integer;
begin
TempValue: = AValue;
//from the virtual method there is a call of the core of not virtual
result: = AddChartValue;
end;

[/spoiler] or generally here so (all superfluous IFDEF are removed)
[spoiler]

Procedure Delete (ValueIndex:Integer); overload;>>> virtual; <<<
Procedure Delete (Start, Quantity:Integer); overload;
Procedure TChartValueList. Delete (ValueIndex:Integer);
begin
Count: = Count-1;
if ValueIndex <Count then//7.01
begin
System. Move (Value [ValueIndex+1], Value [ValueIndex];
SizeOf (TChartValue) * (Count-ValueIndex)); {5.03}
end;
Modified: = True;
end;
Procedure TChartValueList. Delete (Start, Quantity:Integer);
begin
if Quantity> (Count-Start) then
Quantity: = Count-Start;
Count: = Count-Quantity;
if Start <Count then//7.01
System. Move (Value [Start+Quantity], Value [Start];
SizeOf (TChartValue) * (Count-Start));
Modified: = True;
end;

[/spoiler]
And it is ground on storage exceptional Double.
I see two variants
1) to Get in series certain TDictionary <Double, MyObject>, to store all objects there, and TChartValueList to use for storage of keys of these objects. This method smells slightly  and is not clear what to do with not virtual methods?
2) To go a way  and to superimpose all Add/Insert/Delete/Exchange... At the series. There will be a lot of code, but, on idea, a way correct
Can still, something is?
Yours faithfully, Vasilisk

2

Re: Inheritance TGanttSeries

As a result the ten methods at a series superimposed. It turned out horribly and with one . It did not turn out to make at me modification of this internal list before . In the beginning  then adding/removal of objects

3

Re: Inheritance TGanttSeries

: I when did splines, too shoveled, that two series to push in one)
[quote = _ Vasilisk _] it did not turn out to make at me modification of this internal list before

In the same place, if to me does not change storage, in CustomSeries is Begin/EndUpdate