Proposed patch for series source list filling
Posted: Thu Jul 23, 2009 8:52 am
I have an MDI application, and my charts are on frames, and these frames are (dynamically) placed (fromes on frames etcetera) on MDI forms.
This induces a problem when my user wants to add a new calculated series to a chart using the chart editor: the source series list is empty.
I have managed to patch the TeeFuncEdit sourcecode where the list is actually filled. Please consider adding the modified code to the next Teechart8 release.
Regards
Hans
These are the patched functions:
This induces a problem when my user wants to add a new calculated series to a chart using the chart editor: the source series list is empty.
I have managed to patch the TeeFuncEdit sourcecode where the list is actually filled. Please consider adding the modified code to the next Teechart8 release.
Regards
Hans
These are the patched functions:
Code: Select all
procedure AddFrom(Component:TComponent; const Prefix:String);
var t : Integer;
begin
with Component do
for t:=0 to ComponentCount-1 do
if Components[t] is TChartSeries then
{$ifdef HH_PATCH_TC_FILLSOURCES}
begin
{$endif}
if Components[t] is TChartSeries then
AddSource(TChartSeries(Components[t]),Prefix);
{$ifdef HH_PATCH_TC_FILLSOURCES}
// HH: recurse because actually series may be owned by other components as well!
AddFrom(Components[t],'');
end;
{$endif}
end;
procedure AddMDISources;
var t : Integer;
begin
with Application.MainForm.ActiveMDIChild do // 8.0 TV52012071
for t:=0 to ComponentCount-1 do
{$ifdef HH_PATCH_TC_FILLSOURCES}
// HH: Charts may, off course, also reside on frames of MDI forms
if (Components[t] is TCustomChart) or (Components[t] is TCustomFrame) then
{$else}
if Components[t] is TCustomChart then
{$endif}
begin
if Assigned(TheSeries.Owner) then
AddFrom(TheSeries.Owner,'');
break;
end;
end;