Missing events in TColorLineTool

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Lenfors
Newbie
Newbie
Posts: 49
Joined: Thu Sep 20, 2007 12:00 am

Missing events in TColorLineTool

Post by Lenfors » Mon Jul 11, 2011 9:20 pm

Hello!

I'm missing the events OnMouseEnter and OnMouseLeave for the TColorLineTool.

When I right click on a TColorLineTool I want my popupmenu to activate the feature "Delete ColourLine".
Is there some other way to do this without the above events?

Regards, Mikael

Yeray
Site Admin
Site Admin
Posts: 9533
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Missing events in TColorLineTool

Post by Yeray » Tue Jul 12, 2011 10:37 am

Hello,

You could use Chart's OnMouseDown event in combination with the tool Clicked function to check if the TColorLine has been clicked. For example:

Code: Select all

procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var i: Integer;
begin
  for i:=0 to Chart1.Tools.Count-1 do
    if (Chart1.Tools[i] is TColorLineTool) then
      if (Chart1.Tools[i] as TColorLineTool).Clicked(X,Y) then
      begin
        Chart1.Tools.Remove(Chart1.Tools[i]);
        Chart1.Repaint;
      end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply