TeeChart Problem

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
JYM
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Location: Spain
Contact:

TeeChart Problem

Post by JYM » Wed Jul 14, 2004 7:40 am

I have a TDBChart and my problem is that in TDBChart.DblClick event I open the tools dialogs as the example and then, when I select the grafic and close the dialog I get the mouse as left button clicked and "zoom tool" opened.

This is the event where I try to control this

procedure TFormGrafico.DBChartGraficoDblClick(Sender: TObject);
begin
inherited;

EditChartPart(Self, DBChartGrafico, PartChart);
DBChartGrafico.CancelMouse := true;
end;


I have read the example that the TeeChart has and it use something similar. I don't know what is the problem.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jul 14, 2004 8:40 am

Hi,

which Teechart Pro version are you using ? It works fine here using the latest TeeChart Pro v7.01 available for download on our web site , using the folowing code :

procedure TFormGrafico.DBChartGraficoDblClick(Sender: TObject);
begin
EditChartPart(Self, DBChartGrafico, PartChart);
DBChartGrafico.CancelMouse := true;
end;

Also, if you're using older versions you should be able to solve it with the following trick :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(10);
DoubClick := false;
end;

procedure TForm1.DBChart1DblClick(Sender: TObject);
begin
  DoubClick := true;
  EditChartPart(Self, DBChartGrafico, PartChart); 
end;

procedure TForm1.DBChart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  dbChart1.CancelMouse := DoubClick;
  DoubClick := false;
end;
Have you tried it ?

JYM
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Location: Spain
Contact:

I tried It but it doesn't work

Post by JYM » Wed Jul 14, 2004 10:07 am

I tried to do it but i couldn't do DoubClick := true;

How can I do to use this source?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jul 14, 2004 11:49 am

Hi,

DoubClick is a simple Boolean variable defined in the private or public section.
If you still having problems let me know and I'll prepare an example and will post it into the steema.public.attachments newsgroup for you.

JYM
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Location: Spain
Contact:

I still have the same problem

Post by JYM » Wed Jul 14, 2004 1:52 pm

Josep, sorry about that but i tried to solve my problem using code as you post here but i still have the same problem.

Try to solve it, i don't know how to do it, thanks

If you post it into the steema.public.attachments newsgroup please tell me.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jul 14, 2004 2:43 pm

Hi Jym,

sorry, I've seen a better way to solve this, it's using the Abort; procedure after the chart editor closes :

procedure TForm1.ChartEditor1Close(Sender: TObject);
begin
Abort;
end;

JYM
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Location: Spain
Contact:

Still fails

Post by JYM » Wed Jul 14, 2004 2:55 pm

Josep, I tried to solve it with Abort as you tell me but it doesn't work. I don't know de reason.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jul 14, 2004 5:19 pm

Hi Jym,
could you please post an example in the newsgroup I mentioned in my other posts so I can reproduce the problem "as is" here ?
Also please tell me which TeeChart Pro version are you using.

Post Reply