Editor for Rectangle Tool properties?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
moelski
Advanced
Posts: 212
Joined: Mon Apr 23, 2007 12:00 am
Location: Germany
Contact:

Editor for Rectangle Tool properties?

Post by moelski » Sun Mar 02, 2008 6:29 pm

Hi !

Here http://www.teechart.net/support/viewtopic.php?t=7144 is asked about an editor which only shows the title properties.

It ends up with this code:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject); 
var Form      : TForm; 
    Panel     : TPanel; 
    TheTitle  : TFormTeeTitle; 
begin 
  Form := TForm.Create(self); 
  Form.Caption      := 'Set Title'; 
  Form.BorderStyle  := bsSizeToolWin; 
  Form.Height       := 300; 
  Form.Width        := 400; 
  Panel := TPanel.Create(Form); 
  Panel.Parent  := Form; 
  Panel.Align   := AlClient; 

  TheTitle := TFormTeeTitle.CreateTitle(Self,Chart1,Chart1.Title); 
  AddFormTo(TheTitle, Panel); 
  TheTitle.Align := AlClient; 

  Form.ShowModal; 
  Form.Free; 
end;
Is it possible to modify te code for editing the properties of a rectangle tool?

We use the rectangle tool to add marker within the chart. And it would be great if the user had an easy way for editing the properties of the tool.

moelski
Advanced
Posts: 212
Joined: Mon Apr 23, 2007 12:00 am
Location: Germany
Contact:

Post by moelski » Tue Mar 04, 2008 4:14 pm

Hi all,

well I figured out a way :D

Code: Select all

procedure TForm.EditAnnoSettingsClick(Sender: TObject);
var Form      : TForm;
    Panel     : TPanel;
    ToolClass : TClass;
    ToolForm  : TForm;
begin
  Form := TForm.Create(self);
  Form.Caption      := 'Marker anpassen ...';
  Form.BorderStyle  := bsSizeToolWin;
  Form.Height       := 300;
  Form.Width        := 400;
  Panel := TPanel.Create(Form);
  Panel.Parent  := Form;
  Panel.Align   := AlClient;

  ToolClass := TAnnotationToolEdit;
  if Assigned(ToolClass) then
  begin
    ToolForm := TFormClass(ToolClass).Create(Self);
    TeeTranslateControl(ToolForm);
    ToolForm.Align := alClient;
    AddFormTo(ToolForm, Panel,Chart1.Tools[0]);
  end;

  Form.ShowModal;
  Form.Free;
end;
The only thing to change is to replace Chart1.Tools[0] with the correct tool.

Post Reply