TChart repaint failure

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
RichTat
Newbie
Newbie
Posts: 5
Joined: Wed May 05, 2010 12:00 am

TChart repaint failure

Post by RichTat » Mon Jun 21, 2010 3:47 pm

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 ?

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

Re: TChart repaint failure

Post by Narcís » Wed Jun 23, 2010 8:34 am

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.
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

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

Re: TChart repaint failure

Post by Narcís » Wed Jun 23, 2010 8:50 am

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.
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

RichTat
Newbie
Newbie
Posts: 5
Joined: Wed May 05, 2010 12:00 am

Re: TChart repaint failure

Post by RichTat » Wed Jun 23, 2010 3:07 pm

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

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

Re: TChart repaint failure

Post by Narcís » Fri Jun 25, 2010 12:02 pm

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.
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

RichTat
Newbie
Newbie
Posts: 5
Joined: Wed May 05, 2010 12:00 am

Re: TChart repaint failure

Post by RichTat » Mon Jun 28, 2010 2:22 pm

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

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

Re: TChart repaint failure

Post by Narcís » Thu Jul 01, 2010 11:54 am

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.
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

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TChart repaint failure

Post by Yeray » Fri Jul 02, 2010 2:52 pm

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 32496 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?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

RichTat
Newbie
Newbie
Posts: 11
Joined: Tue Jul 03, 2007 12:00 am
Contact:

Re: TChart repaint failure

Post by RichTat » Mon Jul 05, 2010 1:08 pm

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

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

Re: TChart repaint failure

Post by Narcís » Wed Jul 07, 2010 1:42 pm

Hi RichTat,

Thanks for your feedback. We are working on fixing the issue for the next maintenance release.
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

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TChart repaint failure

Post by Yeray » Thu Jul 08, 2010 7:03 am

Hi RichTat,

We have fixed the problem TV52014993 so it will be available in the next maintenance release.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply