Page 1 of 1

Issue with Frames and TCursortool

Posted: Thu Jul 20, 2017 8:54 am
by 16580510
When I put a TeeChart with a Cursortool on a Frame, I get the message that the ancestor component '' could not be found.
A similar message occurs on develop- and runtime, see screenshots.
On the FrameProblemRuntimeStack.jpg it can be seen that the component where Delphi is looking for is either the Cursortool or the Annotationtool.
Luckily I could create a sampleproject that illustrates the problem, see attachment.

The problem occurs on Delphi XE8, 10.1 and 10.2.
The Teechart version on 10.1 is 2017.21.170329.
On the other Delphi Versions there are older TeeCharts that shows the same problem.

On my real application the problem does not always occur.
Sometimes it shows up at runtime only, sometimes not at all.
It occurs even if I put the frame on an empty form.
So it has nothing to do with deleting components from the embedded frame.
Obviously the errormessage at Embarcaderos side is nonense, they should at least tell which component is not found.

Regards
Gerhard Sachs

Re: Issue with Frames and TCursortool

Posted: Fri Jul 21, 2017 7:47 am
by yeray
Hello,

In the Unit2.dfm I see you are modifying the unnamed TAnnotationTool inside the TCursorTool:

Code: Select all

      inherited CursorTool3: TCursorTool
        inherited TAnnotationTool
          Shape.Left = 365
        end
      end
If I remove it to have this:

Code: Select all

      inherited CursorTool3: TCursorTool
      end
Then I can open the project and run it without errors. Well, it seems to give errors depending on what units are opened at designtime and in what order I've opened them, but it seems to run fine if I close all the units.

Re: Issue with Frames and TCursortool

Posted: Fri Jul 21, 2017 9:16 am
by 16580510
Hello Yeray,

you found a way to remove the problem.
But the question ist still, what causes it.
Simply remove the frame from the mainform, save, close and reopen the project.
Then place the frame again at the form without any modifications.
The annotationtool is still listed in the forms dfm causing the same error.

Meanwhile I found that the problem goes away if I remove the Cursortool in the frame and then add it again.
It seems that something in frames Chartdefinition is wrong.

Whatever the reason may be you can close this case now.

Regards
Gerhard

Re: Issue with Frames and TCursortool

Posted: Tue Aug 01, 2017 10:51 am
by yeray
Hello Gerhard,

I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1901