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 - TColorBandTool OnClick event is fired before releasing the mouse button
Summary: TColorBandTool OnClick event is fired before releasing the mouse button
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Tools (show other bugs)
Version: 140923
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.teechart.net/support/viewt...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-20 11:37 EDT by yeray alonso
Modified: 2015-05-21 06:04 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
test case (2.15 KB, application/x-zip-compressed)
2015-05-21 06:04 EDT, david berneda
Details

Note You need to log in before you can comment on or make changes to this bug.
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