TCursor refresh bug
TCursor refresh bug
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
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
Re: TCursor refresh bug
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.
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.
Re: TCursor refresh bug
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.
But I can see that it could fail if there are some non mouse events that change the form position or size.
Re: TCursor refresh bug
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: 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: 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.
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: 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: 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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TCursor refresh bug
Hi Yeray
Yes this is what I was experiencing. I look forward to the next release then.
Kjaran
Yes this is what I was experiencing. I look forward to the next release then.
Kjaran
Re: TCursor refresh bug
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.
Is there a fix or workaround?
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.
Is there a fix or workaround?
- Attachments
-
- TeeChartCursorTest2.zip
- SampleProject
- (3.03 KiB) Downloaded 337 times
Re: TCursor refresh bug
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
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TCursor refresh bug
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?
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?
Doing so would probably undo zoom/scroll in your chart.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;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TCursor refresh bug
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
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
Re: TCursor refresh bug
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).
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |