Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2087

Summary: Loosing axis OnClick event after calling TeeCreateMetafile
Product: VCL TeeChart Reporter: John Ioannides <johnnious>
Component: AxisAssignee: yeray alonso <yeray>
Status: RESOLVED FIXED    
Severity: critical CC: yeray
Priority: ---    
Version: 24.180321   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version: RAD 10.2 Tokyo
Attachments: Sample application to recreate the issue

Description John Ioannides 2018-09-15 03:03:45 EDT
Created attachment 856 [details]
Sample application to recreate the issue

Attached you can find a sample app, first click on any axis and the onclick event fires, then click on the Click me button and try to click on any axis, the onclick event does not fire
Comment 1 yeray alonso 2018-09-18 04:12:54 EDT
I can't zoom or scroll, so all the events seem to be lost after calling TeeCreateMetafile.

Worked fine in v8.08.
Reproduced in v2012.07,... and v2018.25.
Comment 2 John Ioannides 2018-09-18 04:17:05 EDT
If you add a refresh command for the chart after TeeCreateMetafile it seems to be working
Comment 3 yeray alonso 2018-09-18 04:34:31 EDT
Thanks for noticing the workaround.

Closing the gap... I could reproduce it in v2010.01. So the change should be between v8.08 and v2010.01.
Comment 4 yeray alonso 2022-09-16 09:34:33 EDT
When drawing the chart to a metafile with a different size, the internal properties (ie axis positions) are recalculated.

We introduced a condition in v2010.01 to avoid redrawing the chart if BufferedDisplay was set to true, which is the default value.
Then, since the chart isn't redrawn with it's original size, some of its internal properties are refreshed and methods like axis Clicked don't work as expected.

I'm adding an internal variable to store the value of BufferedDisplay, and I'm setting to to True when drawing a metafile (and restoring it afterwards) to force the chart to be redrawn after creating the metafile.