Page 1 of 1

TRectangleTool jumps on dragging

Posted: Fri Oct 20, 2006 4:18 pm
by 9236620
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

Posted: Mon Oct 23, 2006 9:48 am
by narcis
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;