Page 1 of 1

TAnnotationTool disappears

Posted: Thu Oct 31, 2013 6:22 am
by 9236183
Hi,
I must be missing something obvious here. This used to work so not sure what I'm doing wrong.

I create a TAnnotationTool in the FormShow() and then update it from a OnTimer() event. When I update it in the OnTimer it disappears ?

Code looks like this :-

void __fastcall TForm1::FormShow(TObject *Sender) {
chartAnno = new TAnnotationTool(Chart1);
chartAnno->ParentChart = Chart1;
chartAnno->PositionUnits = muPercent;
chartAnno->Shape->Left = 50;
chartAnno->Shape->Top = 50;
chartAnno->Shape->Transparent = true;
chartAnno->Text = "Did this work";
}
void __fastcall TForm1::Timer1Timer(TObject *Sender) {
chartAnno->Text = "why";
}

Re: TAnnotationTool disappears

Posted: Thu Oct 31, 2013 6:33 am
by 9236183
I also tried adding Chart1->Tools->Add(chartAnno); turning off GDI+ and a number of other things but no luck.

I'm using the Beta 2013_130920

Re: TAnnotationTool disappears

Posted: Thu Oct 31, 2013 6:35 am
by 9236183
Actually just added the following to the Timer1Timer() :=

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
chartAnno->Text = "why";
chartAnno->Shape->Left = 50;
chartAnno->Shape->Top = 50;
}

and it is drawn correctly. Is there a reason for this ?

Re: TAnnotationTool disappears

Posted: Thu Oct 31, 2013 6:52 am
by 9236183
Just to follow on from this, however if I had a second TAnnotationTool and change this values text in the OnTimer() the other TAnnotationTool value text disappears.

arrghh.

Re: TAnnotationTool disappears

Posted: Sun Nov 03, 2013 6:35 am
by 9236183
I have found the issue is muPercent.

If I change that to pixels and set the % values myself it draws correctly.

Looks like a bug to do with muPercent.

Re: TAnnotationTool disappears

Posted: Tue Nov 05, 2013 12:48 pm
by narcis
Hello,

Thanks for your feedback. I have added the issue to bugzilla to be fixed for future releases.