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 1218

Summary: TColorBandTool OnClick event is fired before releasing the mouse button
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: ToolsAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: enhancement CC: david
Priority: ---    
Version: 140923   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: http://www.teechart.net/support/viewtopic.php?f=3&t=15592
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: test case

Description yeray alonso 2015-05-20 11:37:10 EDT
The customer explains it well:
"Although it has an event that is named OnClick, it is some kind of a OnMouseDown-event: It gets triggered immediately, even when the mouse button is still down"

Simple code to reproduce the issue:

uses Series, TeeTools;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;

  Chart1.AddSeries(TLineSeries).FillSampleValues;

  with Chart1.Tools.Add(TColorBandTool) as TColorBandTool do
  begin
    Axis:=Chart1.Axes.Bottom;
    StartValue:=5;
    EndValue:=10;
    OnClick:=ColorBandClick;
  end;
end;

procedure TForm1.ColorBandClick(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
begin
  ShowMessage('ColorBand Clicked');
end;
Comment 1 david berneda 2015-05-21 06:03:58 EDT
Fixed. Now the OnClick event is called on mouse-up, and only when the colorband has not been dragged.
Comment 2 david berneda 2015-05-21 06:04:16 EDT
Created attachment 451 [details]
test case