Hi,
The legend is active and I have a TLegendScrollBar in it.
Due the fact I want to be able to use the charts doubleclick event for navigation issues, I need to know where the users performs a doubleclick within the chartarea.
Meaning. If a user doubleclicks within the legendarea nothing should happen and by double clicking in the chartarea and not in the legendarea I call some code.
How can I detect where a doubleclick occurs?
Thanks,
Eric.
Detect doubleclick
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Detect doubleclick
Hi Eric,
You can use OnMouseDown event combined with OnDblClick and PointInRect method, for example:
You can use OnMouseDown event combined with OnDblClick and PointInRect method, for example:
Code: Select all
var
Form1: TForm1;
XPos : Integer;
YPos : Integer;
implementation
{$R *.dfm}
uses TeCanvas;
procedure TForm1.Chart1DblClick(Sender: TObject);
begin
if PointInRect(Chart1.ChartRect, XPos, YPos) then
Chart1.Title.Text[0]:='Chart area clicked'
else
Chart1.Title.Text[0]:='no click';
end;
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
XPos:=X;
YPos:=Y;
end;
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 |