Title editor only?

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:

Title editor only?

Post by moelski » Tue Jan 08, 2008 7:54 am

Hi support,

is it possible to use only that part of the charteditor which is responsible for editing the title? Our customers want to change the title of the chart without using the whole charteditor.

It should like a window with the following items ...
Image

Is this possible ?

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 08, 2008 8:31 am

Hi Dominik,

Yes, this is possible using a TChartEditor and setting HideTabs to all tabs except for cetTitles. You can do this either at run-time or design-time. A run-time example can be found at All Features\Welcome!\Components\Chart Editor\Chart Editor dialog.
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
Advanced
Posts: 212
Joined: Mon Apr 23, 2007 12:00 am
Location: Germany
Contact:

Post by moelski » Tue Jan 08, 2008 8:54 am

Hi Narcis,

Ok that works, but there is one problem left ...
Image

The Tabs at the top of the form are not really nice in this case ... Can I hide them, too?

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 08, 2008 8:57 am

Hi Dominik,

I'm afraid not. You could try setting the editor in tree mode or customizing your chart editor.
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
Advanced
Posts: 212
Joined: Mon Apr 23, 2007 12:00 am
Location: Germany
Contact:

Post by moelski » Tue Jan 08, 2008 9:10 am

Hi Narcis,

well tree mode is not better then the normal mode.

Would it be a solution to build my own Dialog? I found something like this within the V8 demo :

Code: Select all

InsertTeeObjectForm(PageControl1,Chart1.Title).RefreshControls(Chart1.Title);
But the example won´t work in the V8 demo. Could you please give me an example which creates the toolbox within a form?

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 08, 2008 10:07 am

Hi Dominik,

Have you tried adding necessary units in the uses section?

Code: Select all

Uses TeeCustomShapeEditor;

procedure TForm1.FormCreate(Sender: TObject);
begin
  InsertTeeObjectForm(PageControl1,Chart1.Title).RefreshControls(Chart1.Title);
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
Advanced
Posts: 212
Joined: Mon Apr 23, 2007 12:00 am
Location: Germany
Contact:

Post by moelski » Tue Jan 08, 2008 10:32 am

Hi Narcis,

is it only possible to use Function InsertTeeObjectForm with a pagecontrol?
Function InsertTeeObjectForm(APageControl:TPageControl; AShape:TTeeCustomShape):TFormTeeShape;

Is there no way to use a form instead ?

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

Post by moelski » Tue Jan 08, 2008 10:54 am

Hi Narcis,

ok I tried to add a form with a pagecontrol.

Then I use:
InsertTeeObjectForm(Form1.PageControl1,Chart1.Title).RefreshControls(Chart1.Title);
to create the Editor.

This works, but only Format and Border are filled. Text, Gradient, Shadow, Picture are complete empty.

Look at the demo -> Miscellaneous -> Titles and Footers -> Generic Format

You will see that Text, Gradient, Shadow, Picture are white / empty, too.

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

Post by moelski » Wed Jan 09, 2008 1:37 pm

Hi !

No idea what causes this problem ?

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jan 14, 2008 12:16 pm

Hi Dominik,

using the following code should be the correct way :

Code: Select all

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, StdCtrls, Buttons, TeeEdit, TeEngine, Series, ExtCtrls,
  TeeProcs, Chart, ComCtrls, TeeCustomShapeEditor, TeeEdiGrad, TeeEdiFont, TeCanvas, TeePenDlg, TeeBackImage, TeeShadowEditor;

type
  TForm1 = class(TForm)
    PageControl1: TPageControl;
    procedure FormCreate(Sender: TObject);
    procedure PageControl1Change(Sender: TObject);
  private
    { Private declarations }
    TheTitle           : TChartTitle;
    ITeeObject    : TFormTeeShape;
    FFontEditor     : TTeeFontEditor;
    FGradientEditor : TTeeGradientEditor;
    FImageEditor    : TBackImageEditor;
    FShadowEditor   : TTeeShadowEditor;

  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin   InsertTeeObjectForm(PageControl1,Chart1.Title).RefreshControls(Chart1.Title);
end;

procedure TForm1.PageControl1Change(Sender: TObject);
begin
  with TPageControl(Sender) do
  if ActivePage.ControlCount=0 then
     if ActivePage=PageControl1.Pages[2] then
     begin
       FFontEditor:=InsertTeeFontEditor(Pagecontrol1.Pages[2]);

       if Assigned(Chart1.Title) then
          FFontEditor.RefreshControls(Chart1.Title.Font);
     end
     else
     if ActivePage=Pagecontrol1.Pages[3] then
     begin
       if Assigned(Chart1.Title) then
       begin
         FGradientEditor:=TTeeGradientEditor.CreateCustom(nil,Chart1.Title.Gradient);
         AddFormTo(FGradientEditor,PageControl1.Pages[3]);
       end;
     end
     else
     if ActivePage=PageControl1.Pages[4] then
     begin
       FShadowEditor:=InsertTeeShadowEditor(PageControl1.Pages[4]);

       if Assigned(Chart1.Title) then
          FShadowEditor.RefreshControls(Chart1.title.Shadow);
     end
     else
     if ActivePage=Pagecontrol1.Pages[5] then
     begin
       FImageEditor:=InsertImageEditor(PageControl1.Pages[5]);

       if Assigned(Chart1.title) then
          FImageEditor.RefreshControls(Chart1.Title.Picture);
     end;
end;

end.

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

Post by moelski » Fri Jan 18, 2008 11:04 am

Hi Pep,

Works great so far.

But I miss the tab "Style" and "Position". Is it possible to add this two tabs into the pagecontrol?

Then I would have a perfect solution to change the title. :)

xxxxxx
Advanced
Posts: 128
Joined: Tue Jun 19, 2007 12:00 am
Location: Russia
Contact:

Post by xxxxxx » Sun Jan 20, 2008 6:52 pm

Hi, Pep and Dominik!
Isn't it simpler? :wink:

Code: Select all

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, ComCtrls, TeeEdiTitl, TeePenDlg, Chart, Series, TeEngine, TeeProcs;
type
  TForm1 = class(TForm)
    Chart1: TChart;
    Series1: TAreaSeries;
    Panel1: TPanel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    TheTitle           : TFormTeeTitle;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  TheTitle := TFormTeeTitle.CreateTitle(Self,Chart1,Chart1.Title);
  AddFormTo(TheTitle,Panel1);
  TheTitle.Align:=AlClient;
end;

end.
Regards, Alexander
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009

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

Post by moelski » Mon Jan 21, 2008 9:05 am

Hi Alex,

your code is great and works perfect. Thx alot !!!

I have added some line to create the form and the panel from code. Now it looks like this:

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;
Annotation: You need to include TeeEdiTitl, TeePenDlg.

Thx again ! :D

xxxxxx
Advanced
Posts: 128
Joined: Tue Jun 19, 2007 12:00 am
Location: Russia
Contact:

Post by xxxxxx » Mon Jan 21, 2008 7:46 pm

9349911 wrote: your code is great and works perfect.
It isn't mine, it's Steema's!
UTSL!!!:wink:
Regards, Alexander
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009

Post Reply