Show TFormTeeSeries in a seperated Window?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
moelski
Newbie
Newbie
Posts: 92
Joined: Tue Jun 19, 2007 12:00 am
Contact:

Show TFormTeeSeries in a seperated Window?

Post by moelski » Tue Jan 13, 2009 10:29 am

Hi !

I need the TFormTeeSeries in a window to set the Series Properties. I don´t want to use the whole Chart editor.

I tried this code:

Code: Select all

procedure TLVMainForm.dxBarButton1Click(Sender: TObject);
Var Node          : TTreeNode;
    TheFormSeries : TFormTeeSeries;
begin
    TheFormSeries:=TFormTeeSeries.Create(Self);

    With TheFormSeries do
    begin
      TheListBox:=ChartListBox1;
      BorderIcons:=[];
      //BorderStyle:=TeeFormBorderStyle;
      Parent:= LVMainForm; //TabSeries;
      Align:=alClient;
      ShowTabDataSource:=False;
      ShowTabGeneral:=True;
      ShowTabMarks:=True;
      TheSeries:=ChartListBox1.SelectedSeries;

      {$IFDEF CLX}
      TeeFixParentedForm(TheFormSeries);
      {$ENDIF}

      TeeScaleForm(TheFormSeries);

      Show;
    end;

    TeeTranslateControl(TheFormSeries,[TheFormSeries.CBSeries]);

  TheFormSeries.SetCBSeries;
end;
But I get only an empty window with a selection box for the series.

Can you give me a working example, please?

moelski
Newbie
Newbie
Posts: 92
Joined: Tue Jun 19, 2007 12:00 am
Contact:

Post by moelski » Tue Jan 13, 2009 11:12 am

Ok I got it by myself ...

This works:

Code: Select all

procedure TLVMainForm.dxBarButton1Click(Sender: TObject);
Var Node          : TTreeNode;
    Form          : TForm;
    TheFormSeries : TFormTeeSeries;
begin
  Form := TForm.Create(self);
  Form.Caption      := 'Form';
  Form.BorderStyle  := bsSizeToolWin;
  Form.Height       := 300;
  Form.Width        := 400;

  TheFormSeries:=TFormTeeSeries.Create(Self);

  With TheFormSeries do
  begin
    ChartListBox1.OtherItems:=CBSeries.Items;
    TheListBox:=ChartListBox1;
    BorderIcons:=[];
    BorderStyle:=TeeFormBorderStyle;
    Parent:= Form; //TabSeries;
    Align:=alClient;
    ShowTabDataSource:=False;
    ShowTabGeneral:=True;
    ShowTabMarks:=True;
//      //IsDssGraph:=Self.IsDssGraph;
    TheSeries:=ChartListBox1.SelectedSeries;
    ChartListBox1.FillSeries(TheSeries);

    {$IFDEF CLX}
    TeeFixParentedForm(TheFormSeries);
    {$ENDIF}

    TeeScaleForm(TheFormSeries);

    //OnTeeEvent:=Self.FormSeriesEvent;

    Show;
  end;

  TeeTranslateControl(TheFormSeries,[TheFormSeries.CBSeries]);

  TheFormSeries.SetCBSeries;

  Form.ShowModal;

  TheFormSeries.TheSeries := NIL;
  TheFormSeries.Free;
  ChartListBox1.OtherItems := NIL;
  Form.Free;
end;

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

Post by Narcís » Tue Jan 13, 2009 11:19 am

Hi moelski,

Yes, you can do this:

Code: Select all

uses TeeEdiSeri, TeeConst, TeeFLineEdi;

procedure TForm1.Button1Click(Sender: TObject);
var TheFormSeries : TCustomForm;
begin
  if (Chart1[0] is TFastLineSeries) and (Assigned(TheFormSeries)) then
     TheFormSeries:=TFormTeeSeries.InsertSeriesForm(Parent,TFastLineSeriesEditor,
                                                     1,TeeMsg_GalleryLine,
                                                     Chart1[0]);

  TheFormSeries.ShowModal;
  FreeAndNil(TheFormSeries);
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

moelski
Newbie
Newbie
Posts: 92
Joined: Tue Jun 19, 2007 12:00 am
Contact:

Post by moelski » Tue Jan 13, 2009 11:27 am

Hi Narcis,

but your solution works only with FastLineSeries, right?
What I need is a "global" solution for all series types.

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

Post by Narcís » Tue Jan 13, 2009 11:32 am

Hi moelski,

Sorry, I see we crossed posts.
but your solution works only with FastLineSeries, right?
Yes.
What I need is a "global" solution for all series types.
Does the solution you found solve that?

Thanks in advance.
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

moelski
Newbie
Newbie
Posts: 92
Joined: Tue Jun 19, 2007 12:00 am
Contact:

Post by moelski » Tue Jan 13, 2009 11:45 am

Hi Narcis,

yes my version seems to work as expected.

I found a solution for editing the Axis only, too:

Code: Select all

procedure TLVMainForm.dxBarButton11Click(Sender: TObject);
var Form      : TForm;
    Panel     : TPanel;
  tmpForm     : TFormTeeAxis;
begin
  Form := TForm.Create(self);
  Form.Caption      := 'Achsen';
  Form.BorderStyle  := bsSizeToolWin;
  Form.Height       := 300;
  Form.Width        := 400;

 // if not Assigned(TheAxis) then TheAxis:=Chart.LeftAxis;
  tmpForm:=TFormTeeAxis.CreateAxis(Self,  //TheAxis);
  ChartListBox1.SelectedSeries.GetVertAxis);

  with TFormTeeAxis(tmpForm) do
  begin
    TheAxis:=TChartAxis(ChartListBox1.SelectedSeries.GetVertAxis);
  //  LBAxes.ItemIndex:=Node.Index;
    PageAxisChange(PageAxis);
    PageAxis.Parent:=Form;
  end;

  Form.ShowModal;
  Form.Free;
end;

Post Reply