Page 1 of 1
Problem / Question with EditChartPart()
Posted: Tue Jul 13, 2004 12:25 pm
by 8574692
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.
Posted: Tue Jul 13, 2004 1:53 pm
by Pep
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;
It doesn't works
Posted: Tue Jul 13, 2004 3:40 pm
by 8574692
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
Posted: Tue Jul 13, 2004 4:13 pm
by Pep
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 ?
TDBChart
Posted: Tue Jul 13, 2004 4:32 pm
by 8574692
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.
Posted: Wed Jul 14, 2004 8:40 am
by Pep
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 ?