Page 1 of 1

Proposed patch for series source list filling

Posted: Thu Jul 23, 2009 8:52 am
by 10553957
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:

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;

Re: Proposed patch for series source list filling

Posted: Thu Jul 23, 2009 1:18 pm
by yeray
Hi Hans,

Thank you for the information and the fix suggestion. It would be nice if you could also send us a simple example project we can run as-is to reproduce the problem here.

Thanks in advance.

Re: Proposed patch for series source list filling

Posted: Thu Jul 23, 2009 1:55 pm
by 10553957
Managed to add small app. You may have to adjust search paths, off course. For debugging purpose i have added a path to my Teechart8 sources.

Reproduce:

Runn app
Open clild MDI window

Open chart editor

Add anew series/or function eg "Add"

Check source series list. It's empty.

Regards - Hans

Re: Proposed patch for series source list filling

Posted: Thu Jul 23, 2009 2:01 pm
by 10553957
Yeray, can you change my status from newbie into something like 4 stars? I've been using TChart for over 8 years now! (SInce Delphi2 actually) and have some deep knowledge about it by now.

Also I seem to have joined this forum somewhere in 1970 8) . Thats weird since I was only 4 years old and had no computer at the time :lol:

Regards - Hans

Re: Proposed patch for series source list filling

Posted: Fri Jul 24, 2009 8:57 am
by yeray
Hi Hans,

We could reproduce the problem and your changes seems to work fine. So we'd like to thank you for giving it to us at the same time we'd like you to know that this will be included in the next v8 maintenance release.
h.hasenack wrote:Yeray, can you change my status from newbie into something like 4 stars? I've been using TChart for over 8 years now! (SInce Delphi2 actually) and have some deep knowledge about it by now.

Also I seem to have joined this forum somewhere in 1970 8) . Thats weird since I was only 4 years old and had no computer at the time :lol:
The forum ranks are assigned automatically. When you'll arrive at 100 posts your forums rank will be "advanced" and with 1000 posts you'll be known as "gurĂº". I think we can manage the ranks (add more ranks or change the .gif related with each rank) if you feel really uncomfortable with that right now.

Re: Proposed patch for series source list filling

Posted: Fri Jul 24, 2009 9:03 am
by 10553957
The forum ranks are assigned automatically. When you'll arrive at 100 posts your forums rank will be "advanced" and with 1000 posts you'll be known as "gurĂº". I think we can manage the ranks (add more ranks or change the .gif related with each rank) if you feel really uncomfortable with that right now.
Yes it would be nice, but I will survive -and won't sleep less- if you you rather invest your time in other, more important things. 8)

I am very happy my source suggestions and fixes are taken up seriously, thanks!

Hans