Page 1 of 1

v.8.01 - Is it a bug? (ChartEditor again)

Posted: Sun Jul 08, 2007 10:27 am
by 9337075
Hello,

In situations when by some reason a chart is updated with Chart Editor dialog opened it is easy to get an exception:

---------------------------
Project1
---------------------------
Control 'TabSeriesList' has no parent window.
---------------------------
OK
---------------------------

Obvious fix would be to avoid such situations, but maybe a better solution is possible? In complicated applications sometimes it is not easy to have full control on when and why a chart is updated.

Below you will find a simple example reproducing the problem:

1) Create a simple VCL application
2) Place TChart, TTimer and TButton on the main form
3) To make the problem more vivid set Chart1.Legend.LegendStyle = lsSeries
4) Arrange the code of Unit1.pas as follows.

Code: Select all

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeEngine, Series, ExtCtrls, TeeProcs, Chart, StdCtrls, TeeEdit;

type
  TForm5 = class(TForm)
    Timer1: TTimer;
    Button1: TButton;
    Chart1: TChart;
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
    Count: Integer;
  public
    { Public declarations }
  end;

var
  Form5: TForm5;

implementation

uses EditChar, TeeEditCha;

{$R *.dfm}

procedure TForm5.Button1Click(Sender: TObject);
begin
  EditChartPage( Self, Chart1, teeEditGeneralPage );
//  EditChartPage( Self, Chart1, teeEditAxisPage );
//  EditChartPage( Self, Chart1, teeEditMainPage );
end;

procedure TForm5.FormCreate(Sender: TObject);
begin
  Count := 0;
  Chart1.AddSeries(TFastLineSeries);
  Chart1[0].FillSampleValues(100);
  Timer1Timer(Self);
end;

procedure TForm5.Timer1Timer(Sender: TObject);
begin
  Chart1[0].Title := 'Title ' + IntToStr(Count);
  Inc(Count);
  if Count >= 10 then
    Count := 0;
end;

end.
You may experiment with commenting different lines in the Button1Click event handler.

Best regards,
Michael

Posted: Mon Jul 09, 2007 10:05 am
by Pep
Hi Michael,

yes, you're correct , it's a bug. I've fixed it for the next maintenance release, it only happens when Editor is set to Tree mode.
If you're source code customer let me know and I could send to you the modified file so you can recompile the sources and install them again.

Posted: Mon Jul 09, 2007 1:05 pm
by 9337075
Hi Josep,

Yes, I am source code customer (v.8). I've just sent my license details in PM to you.

Of course, I am interested in the latest modifications of the source code.

Best regards,
Michael

Posted: Mon Jul 09, 2007 9:56 pm
by Pep
Hi Michael,

ok, I've sent the required files to fix this bug directly to your mail account.

Posted: Tue Jul 10, 2007 7:18 am
by 9337075
Hi Josep,

Thank you for the fix, now everything works fine!

Best regards,
Michael

Posted: Wed Jul 18, 2007 9:38 pm
by 9047589
I have similar problem with Chart Editor in TeeChart Standard v.7/Delphi 5:

Code: Select all

var
  ChartEditor:TChartEditForm;
begin
  ChartEditor:=TChartEditForm.Create(ParentForm);
  ChartEditor.TheActivePageIndex:=teeEditAxisPage;
  ChartEditor.Tree.Visible:=ShowTree;
  ChartEditor.ShowModal;
  ChartEditor.Free;
end;
This code produced the same error about 'TabSeriesList' if ShowTree was True.
In my TeeChart Standard v.8/Delphi 5 such problem is absent