Problem / Question with EditChartPart()

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:

Problem / Question with EditChartPart()

Post by JYM » Tue Jul 13, 2004 12:25 pm

I have a problem with EditChartPart . I have defined a PartChart as TChartClickedPart in the private part of my source and then I use this source in DblClick event

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


to call the method and then with CancelMouse procedure I try to liberate "memory" but when I close the EditChart Dialog, the selector with mouse become active and draw a select polygon as zoom tool and I don't know how to eliminate it.

Could anyone help me please? It's so important and urgent.

Thanks a lot.

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

Post by Pep » Tue Jul 13, 2004 1:53 pm

Hi Jym,

I think this problem does not happens with the latest TeeChart Pro version, but to solve it for another versions you can do :

Code: Select all

procedure TForm1.Chart1DblClick(Sender: TObject);
begin
  DoubClick := true;
  ChartEditor1.Execute;
end;

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

procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Chart1.CancelMouse := DoubClick;
  DoubClick := false;
end;

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

It doesn't works

Post by JYM » Tue Jul 13, 2004 3:40 pm

Hi, I have the same problem. I'm working with Delphi 5.0 and CharEditor hasn't got Execute method and DblClick is not a declarated event so I can't use your code to try to solve my problem.

I don't know how to act with this, I will accept any king of help, thanks

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

Post by Pep » Tue Jul 13, 2004 4:13 pm

Hi Jym,
private part of my source and then I use this source in DblClick event
Of which component ?
Could you please post a simple project into the steema.public.attachments newsgroup so I can reproduce the problem here ?

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

TDBChart

Post by JYM » Tue Jul 13, 2004 4:32 pm

Hi Pep, my component is a TDBChart and my problem as yoy know 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 ?

Post Reply