Page 1 of 1

TChart repaint failure

Posted: Mon Jun 21, 2010 3:47 pm
by 16456091
TeeChart 2010 does not always repaint a chart after window is brought to the foreground.
Example to illustrate the problem in C++Builder 2010: create series values on form show event with Series1->Add() and add a button with code:

Chart1->TeeCreateBitmap(clRed,Chart1->ClientRect);

After clicking the button, the chart is no longer repainted when the form is brought to the foreground.
Similar effect in Delphi 2010.
This has come to light using TeeChart 2010 with Developer Express printing and preview controls.

is this a bug or am I missing something ?

Re: TChart repaint failure

Posted: Wed Jun 23, 2010 8:34 am
by narcis
Hi RichTat,

I'm not sure how should I reproduce the issue. I implemented a form like this:

Code: Select all

uses Series;

procedure TForm1.FormShow(Sender: TObject);
var i: Integer;
begin
  Chart1.AddSeries(TLineSeries.Create(Self));

  for i:=0 to 10 do
    Chart1[0].Add(random);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Chart1.TeeCreateBitmap(clRed, Chart1.ClientRect);
end;
After I press the button I move other windows above the application and then bring the application to the foreground. Is this what I am supposed to do? Should I change the implementation or perform any other step?

Thanks in advance.

Re: TChart repaint failure

Posted: Wed Jun 23, 2010 8:50 am
by narcis
Hi RichTat,

As an update, I could reproduce a very similar issue which is being discussed here. Is this the same problem at your end?

Thanks in advance.

Re: TChart repaint failure

Posted: Wed Jun 23, 2010 3:07 pm
by 16456091
Hello Narcis

Proceed as follows with C++ Builder 2010 and TeeChart 2010:

Step 1: Create a form
Step 2: Add a TChart component Chart1 (no editing necessary)
Step 3: Add a button
Step 4: Add button click code to produce the following code module:

Code: Select all

#include <vcl.h>
#pragma hdrstop
#include "Unit04.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "Series"
#pragma link "TeEngine"
#pragma link "Chart"
#pragma link "TeeProcs"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
	Chart1->TeeCreateBitmap(clBlack,Chart1->ClientRect );
}
Step 5: Compile and run the program
Step 6: Click the button
Step 7: Bring another window to the foreground maximum screen size to cover the form
Step 8: Bring the form back to the foreground and the chart is not repainted.

RichTat

Re: TChart repaint failure

Posted: Fri Jun 25, 2010 12:02 pm
by narcis
Hi RichTat,

I'm not able to reproduce this. Now I can't reproduce TV52014993 consistently either. Does this occur consistently at your end? I guess it's the same issue as copying to clipboard calls TeeCreateBitmap method. Anyway, we will investigate TV52014993 further.

Re: TChart repaint failure

Posted: Mon Jun 28, 2010 2:22 pm
by 16456091
Hi Narcis

I have tried my program executable on 2 XP and one Vista PC all with the predicted result of non-painting.
I build the project without runtime packages.
You can download my C++ Builder 2010 test project at

http://reetec.co.uk/files/useful/steema99.zip

This includes the project files (based on my development path) and executable.

regards RichTat

Re: TChart repaint failure

Posted: Thu Jul 01, 2010 11:54 am
by narcis
Hi RichTat,

Thanks for the example project. We could reproduce the problem here both in Windows 7 and Windows XP machines. However, I'm not able to reproduce it on my Windows 7 machine :shock:. We are investigating what makes the difference. We will get back to you one we have further news.

Re: TChart repaint failure

Posted: Fri Jul 02, 2010 2:52 pm
by yeray
Hi RichTat,

We've seen that on Windows 7, if you activate "Use visual styles on windows and buttons", the problem isn't reproducible:
perf.png
perf.png (14.07 KiB) Viewed 32353 times
But this option doesn't seem to have the same effect regarding this issue neither on Windows Vista or XP.

We've also seen that forcing a repaint after calling TeeCreateBitmap with Chart1.Draw, the problem disappears.

Could you please confirm this?

Re: TChart repaint failure

Posted: Mon Jul 05, 2010 1:08 pm
by 10045905
Hello Yeray

1) Setting the WINDOWS visual effects option has no effect on our XP development computer
2) Executing the Chart1->Draw() function IMMEDIATELY after the Chart1->TeeCreateBitmap() function in the same procedure eliminates the problem.
3) Executing the Chart1->Draw() function as a separate, later, operation using a separate button redraws the chart but does not remove the problem.

Regards
RichTat

Re: TChart repaint failure

Posted: Wed Jul 07, 2010 1:42 pm
by narcis
Hi RichTat,

Thanks for your feedback. We are working on fixing the issue for the next maintenance release.

Re: TChart repaint failure

Posted: Thu Jul 08, 2010 7:03 am
by yeray
Hi RichTat,

We have fixed the problem TV52014993 so it will be available in the next maintenance release.