TCursor refresh bug

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Kjaran
Newbie
Newbie
Posts: 9
Joined: Fri Sep 30, 2011 12:00 am

TCursor refresh bug

Post by Kjaran » Tue Nov 15, 2011 10:36 am

Hi,

I have a problem with the cursor not working correctly after moving a form outside the screen (or mainform for MDI) and back.
The cursor will be visibly stuck but it is possible to move it around.
If you minimize the form and restore it the cursor has moved and is working again.
But as soon as you move it outside again it is bugged.

I have included a sample project where this happens.
Simply move part of the form outside the screen and back then try to use the cursor.

Is there a fix or workaround?

Delphi XE with Update 1, 15.0.3953.35171
TeeChart Pro v2011.03.30407 Win32
Attachments
TeeChartCursorTest.zip
(3.12 KiB) Downloaded 325 times

Kjaran
Newbie
Newbie
Posts: 9
Joined: Fri Sep 30, 2011 12:00 am

Re: TCursor refresh bug

Post by Kjaran » Tue Nov 15, 2011 12:51 pm

Calling Repaint on the cursor fixes the problem.

But I'm not sure when to call it.

If I put it in the Cursor.OnChange the CPU use goes up to 10% when scrolling instead of 0-2%.
In the Form.OnPaint it is good for MDI but if the TChart goes off screen the paint event doesn't trigger.

Kjaran
Newbie
Newbie
Posts: 9
Joined: Fri Sep 30, 2011 12:00 am

Re: TCursor refresh bug

Post by Kjaran » Tue Nov 15, 2011 1:08 pm

I ended up by calling it in the TChart.OnMouseEnter.

But I can see that it could fail if there are some non mouse events that change the form position or size.

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

Re: TCursor refresh bug

Post by Yeray » Wed Nov 16, 2011 11:36 am

Hello Kjaran,

I think I reproduced it. Could you please confirm this is what you are suffering?
If I put another window partially covering the chart and the cursor, like here:
back.png
back.png (8.16 KiB) Viewed 8644 times
Then, when I take the chart back to the front and I try to drag the cursor tool, only the part that was hidden is repainted in the correct position:
move.png
move.png (25.48 KiB) Viewed 8650 times
If this is what you suffered, I could reproduce it with v2011.03 but not with the actual sources so it should be fixed with the next maintenance release. And the application doesn't seem to demand more CPU either.
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

Kjaran
Newbie
Newbie
Posts: 9
Joined: Fri Sep 30, 2011 12:00 am

Re: TCursor refresh bug

Post by Kjaran » Wed Nov 16, 2011 12:16 pm

Hi Yeray

Yes this is what I was experiencing. I look forward to the next release then.

Kjaran

Kjaran
Newbie
Newbie
Posts: 9
Joined: Fri Sep 30, 2011 12:00 am

Re: TCursor refresh bug

Post by Kjaran » Thu Feb 16, 2012 5:22 pm

Hi,

I have now updated to the "TeeChart Pro v2011.04.41118 32bit VCL" and indeed my original problem has been solved, many thanks. :)
And still using "Delphi XE with Update 1, 15.0.3953.35171".

But a new problem was introduced.

If I zoom the cursor again becomes hidden but responds to the mouse hovering and fires events etc.
But calling repaint, redraw, active on the cursor does not show it.
Instead if I unzoom it becomes visible again.

I have included a small sample project where this is possible.
A form with a TChart, TFastSeries with random data and a vertical TCursorTool.
If zoomed on the bottom 1/3 of the chart the cursor becomes hidden, but not on the top 1/3 (weird?).
The cursor in this sample becomes fixed by scrolling up or unzooming.
Zoom.png
TheZoomRectangle
Zoom.png (7.4 KiB) Viewed 8573 times
PostZoom_NoCursorVisible.png
Post zoom, the cursor is now hidden
PostZoom_NoCursorVisible.png (6.08 KiB) Viewed 8590 times
Is there a fix or workaround?
Attachments
TeeChartCursorTest2.zip
SampleProject
(3.03 KiB) Downloaded 337 times

Kjaran
Newbie
Newbie
Posts: 9
Joined: Fri Sep 30, 2011 12:00 am

Re: TCursor refresh bug

Post by Kjaran » Fri Feb 17, 2012 9:44 am

Hi,

Found a fix for my main project. For the OnScroll and OnZoom events I set the cursor series axis to automatic.
Chart1.LeftAxis.Automatic:= true;

This can be used, in my case, since the axis for the cursor is never shown.
But I guess in the cases where it is not this would still be an issue.

Kjaran

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

Re: TCursor refresh bug

Post by Narcís » Mon Feb 20, 2012 10:34 am

Hi Kjaran,

I've made some tests with your project and found that the problem is not consistent and I don't even think it is a bug. Actually the cursor disappears for me when the zoom rectangle dimensions proportions are rather different from the chart rectangle proportions and therefore the zoom rectangle can not be exactly what you drew and hence sometimes the cursor being left out. Is this the behaviour you experienced?
Found a fix for my main project. For the OnScroll and OnZoom events I set the cursor series axis to automatic.
Chart1.LeftAxis.Automatic:= true;
Doing so would probably undo zoom/scroll in your chart.
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

Kjaran
Newbie
Newbie
Posts: 9
Joined: Fri Sep 30, 2011 12:00 am

Re: TCursor refresh bug

Post by Kjaran » Mon Feb 20, 2012 1:56 pm

Hi Narcís,

The two screen-shots are actual shots of the chart. The only modifications I made was to crop the form.

The first screen-shot is while I'm holding the left mouse button down just before releasing it, the rectangle is the zoom rectangle drawn by teechart.
The second is just after releasing the mouse button to zoom in.

The problem as you say is not consistent but this rectangle, on my machine at least, always renders the cursor invisible.
I've only found rectangles that hide the cursor that are very close to or go below the bottom axis.

"Doing so would probably undo zoom/scroll in your chart."
This sample project is simply the smallest code I found to reproduce my error, and would indeed in this sample undo the zoom.
In my actual application the cursor uses a series that is hidden and the axis is never visible.
Setting the axis to automatic solves the cursor visibility problem, and has no side effects since the axis is already hidden.

I thank you for looking into this matter but I'm satisfied with the current workaround and consider this solved.

Kjaran

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

Re: TCursor refresh bug

Post by Yeray » Tue Feb 21, 2012 9:41 am

Hi Kjaran,

I'm happy to hear you are satisfied with the workaround you found, but I've added it to the defect list anyway since I could reproduce it (TV52016047).
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