EInvalidOperation with Chart Editor

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Johann
Newbie
Newbie
Posts: 10
Joined: Thu Sep 22, 2005 4:00 am

EInvalidOperation with Chart Editor

Post by Johann » Fri Sep 30, 2005 7:28 pm

Hi, I keep randomly getting the following message:
EInvalidOperation with message 'Control TabSeries' has no parent window.

This happens on a ChartEditor component when I am going through the Axis tabs.
It is also set to TreeView mode, if this helps.

Thanks,
Johann.

Johann
Newbie
Newbie
Posts: 10
Joined: Thu Sep 22, 2005 4:00 am

Post by Johann » Fri Sep 30, 2005 9:21 pm

This mostly happens in ChartEditor if both Chart and Series properties are entered.

To reproduce it to the following:
1) Drop TChart, TChartEditor on a form
2) Create a new series (leave the default, doesn't matter)
3) Set the Chart and Series properties
4) Set TreeView to True
5) Change DefaultTab to anything other than cetMain
6) Double click chart component to test
7) Exception raised

Any reason why this is happening?

Johann

Johann
Newbie
Newbie
Posts: 10
Joined: Thu Sep 22, 2005 4:00 am

Post by Johann » Sat Oct 01, 2005 12:05 am

Ok, I was going through the TeeEditCha.pas and added break points and found the error occurs around following or somewhere after:

1492| while TreePanel.ControlCount>0 do TreePanel.Controls[0].Parent:=nil;

What do you think? :?

Johann.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Oct 03, 2005 7:36 am

Hi Johann,

I'm not able to reproduce it here, I created a project as you told and when running it and executing the TChartEditor and selecting axes tabs I don't get the error. Is there anything that I should do to force this error or could you please send us an example we can run "as-is" to reproduce the problem here?

You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Johann
Newbie
Newbie
Posts: 10
Joined: Thu Sep 22, 2005 4:00 am

Post by Johann » Mon Oct 03, 2005 12:42 pm

Ok, I have attached a file with the test project in the newsgroups.

Thanks,
Johann.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Oct 03, 2005 3:41 pm

Hi Johann,

Thanks for the example application. I've been able to reproduce the problem here. This is a "silly" bug which you can solve using:

Code: Select all

  ChartEditor1.Series := nil;
  ChartEditor1.Execute;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Johann
Newbie
Newbie
Posts: 10
Joined: Thu Sep 22, 2005 4:00 am

Post by Johann » Mon Oct 03, 2005 4:36 pm

Ok thanks alot for looking at it. Will document it for future reference.

Thanks,
Johann.

spt
Newbie
Newbie
Posts: 8
Joined: Mon Feb 20, 2006 12:00 am

Post by spt » Thu Mar 02, 2006 6:43 pm

Sorry to follow up on an old thread, but I see that this is still a problem in TeeChart 7.06.

I am using BCB6 and have the TeeChart source. Do you have a source fix for this, or a workaround that can be used when using EditChart() to open the editor?

Thanks
Lars

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Mar 09, 2006 8:39 am

Hi Lars,

Yes, I've checked that and added the issue (TV52011310) to our defect list to be fixed for future releases. In the meantime, a workaround is using the code I posted on 3rd October 2005.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

spt
Newbie
Newbie
Posts: 8
Joined: Mon Feb 20, 2006 12:00 am

Post by spt » Tue Mar 14, 2006 10:14 am

Regretfully, your workaround doesn't work when opening the property editor using the method EditChart(). I've tried to use a modified version like this:

Code: Select all

Procedure EditChartPageTreeView(Form:TForm; AChart:TCustomChart; PageIndex:Integer);
begin
  With GetChartEditClass(AChart) do
  try
    TheEditSeries:=nil;
    TheActivePageIndex:=PageIndex;
    Tree.Visible:=True;
    ShowModal;
  finally
    Free;
  end;
end;
but it still gives the EInvalidOperation error. Does your wrokaround only work when using the ChartEditor component? I have tried to use that too, but then I cannot get it to open in treeview mode without setting the registry setting first.

Post Reply