TRectangleTool jumps on dragging

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Messie
Newbie
Newbie
Posts: 34
Joined: Wed Apr 13, 2005 4:00 am
Location: Goettingen, Germany

TRectangleTool jumps on dragging

Post by Messie » Fri Oct 20, 2006 4:18 pm

Hi,

I wanted to use a TRectangle Tool to display actual values as Text. I found some problems:

1. The autosize property does work at designtime but not at the program start. After start and after assigning a new text, I have to set the autosize property again to make it work.

2. I placed the Tool at the right bottom. If I drag it at runtime it jumps to the upper left position. This happens when it is dragged and moved the first time, afterwards it is ok.

3. When I move and drop the RectangleTool out of the Chart canvas it is lost. The dragging out of the canvas should be defeated.

I need a solution for item 2, the other things are nice to have in the next release.

Thanks, Ulfert

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Oct 23, 2006 9:48 am

Hi Ulfert,

Please find below the answers to your questions:

1. This is fixed with TeeChart v8 VCL which is the version we are currently working in.

2. This is also fixed for v8. In the meantime, a solution is using a custom postion instead of the defined ones, for example:

Code: Select all

procedure TForm8.FormCreate(Sender: TObject);
begin
  Chart1.Draw;

  ChartTool1.Shape.CustomPosition:=true;
  ChartTool1.Left:=Chart1.ChartRect.Right - 10;
  ChartTool1.Top:=Chart1.ChartRect.Bottom - 10 ;
end;
3. You can prevent the tool from going out of the chart in the tool OnDragging event:

Code: Select all

procedure TForm8.ChartTool1Dragging(Sender: TObject);
begin
 With ChartTool1 do
 begin
  if (Left < 0) then Left := 0;
  if (Top < 0) then Top := 0;
  if (Left > Chart1.Width - Width) then Left:=Chart1.Width - Width;
  if (Top > Chart1.Height - Height) then Top:=Chart1.Height - Height;
 end;
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
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply