Chart Unexpectedly changes color with mouse movement
Posted: Mon Aug 01, 2016 2:42 pm
One of the IDE's I need to maintain is Delphi 6. I also have XE2, Seattle and Berlin 10.1
I recently upgraded to Steema TeeChartVCLFMXSOURCE-2016.18
The installation went ahead without issue, including the D6 build. All OK.
Now after recompiling my software that uses the D6 IDE, sometimes when I mouse move over a chart area it completely changes color, not always, but most times.
It's quite unpredictable, sometimes when the mouse is only over the chart grid area itself, sometimes when the mouse is anywhere over the chart it suddenly completely changes color.
There is a mouse-move event associated with the chart to draw cross-hairs. That procedure has been there untouched for a long time.
Please see attached images that show what happens to the chart display.
Any ideas what has caused this?
____________________________________________
I recently upgraded to Steema TeeChartVCLFMXSOURCE-2016.18
The installation went ahead without issue, including the D6 build. All OK.
Now after recompiling my software that uses the D6 IDE, sometimes when I mouse move over a chart area it completely changes color, not always, but most times.
It's quite unpredictable, sometimes when the mouse is only over the chart grid area itself, sometimes when the mouse is anywhere over the chart it suddenly completely changes color.
There is a mouse-move event associated with the chart to draw cross-hairs. That procedure has been there untouched for a long time.
Code: Select all
//OnMouseMove Event code:
procedure TTTGraphPagesDlg.Estimated_TT_D2_ChartMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
{ This procedure draws the crosshair lines }
procedure DrawCross(AX,AY:Integer);
begin
with Estimated_TT_D2_Chart,Canvas do
begin
Pen.Color:=CrossHairColor;
Pen.Style:=CrossHairStyle;
Pen.Mode:=pmXor;
Pen.Width:=1;
MoveTo(ax,Estimated_TT_D2_Chart.ChartRect.Top-Height3D);
LineTo(ax,Estimated_TT_D2_Chart.ChartRect.Bottom-Height3D);
MoveTo(Estimated_TT_D2_Chart.ChartRect.Left+Width3D,ay);
LineTo(Estimated_TT_D2_Chart.ChartRect.Right+Width3D,ay);
end;
end;
var
tmpX, tmpY : Double;
ix : Integer;
Lbl : ShortString;
ReturnedHMS : THrsMinSec;
{start of code}
begin
if (C2OldX<>-1) then
begin
DrawCross(C2OldX,C2OldY); { draw old crosshair }
C2OldX:=-1;
end;
{ check if mouse is inside Chart rectangle }
if PtInRect( Estimated_TT_D2_Chart.ChartRect, Point(X-Estimated_TT_D2_Chart.Width3D,Y+Estimated_TT_D2_Chart.Height3D) ) then
begin
DrawCross(x,y); { draw crosshair at current position }
{ store old position }
C2OldX:=x;
C2OldY:=y;
{ set label text }
With Estimated_TT_D2_Chart.Series[2] do
begin
GetCursorValues(tmpX,tmpY); { <-- get values under mouse cursor }
ix := trunc(tmpx);
Lbl := Format('%2.2d:%2.2d', [(ix div 60),(ix mod 60)]);
ReturnedHMS := Extended2HrsMinSec(tmpY*60);
end; {With Estimated_TT_D2_Chart.Series[2]}
end {if PtInRect}
else
StatusBar2.simpleText:= '';
end; {procedure}
Any ideas what has caused this?
____________________________________________