Page 1 of 1
EInvalidOperation with Chart Editor
Posted: Fri Sep 30, 2005 7:28 pm
by 9343376
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.
Posted: Fri Sep 30, 2005 9:21 pm
by 9343376
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
Posted: Sat Oct 01, 2005 12:05 am
by 9343376
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.
Posted: Mon Oct 03, 2005 7:36 am
by narcis
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.
Posted: Mon Oct 03, 2005 12:42 pm
by 9343376
Ok, I have attached a file with the test project in the newsgroups.
Thanks,
Johann.
Posted: Mon Oct 03, 2005 3:41 pm
by narcis
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;
Posted: Mon Oct 03, 2005 4:36 pm
by 9343376
Ok thanks alot for looking at it. Will document it for future reference.
Thanks,
Johann.
Posted: Thu Mar 02, 2006 6:43 pm
by 9345376
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
Posted: Thu Mar 09, 2006 8:39 am
by narcis
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.
Posted: Tue Mar 14, 2006 10:14 am
by 9345376
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.