Page 1 of 1
Title editor only?
Posted: Tue Jan 08, 2008 7:54 am
by 9349911
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 ...
Is this possible ?
Posted: Tue Jan 08, 2008 8:31 am
by narcis
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.
Posted: Tue Jan 08, 2008 8:54 am
by 9349911
Hi Narcis,
Ok that works, but there is one problem left ...
The Tabs at the top of the form are not really nice in this case ... Can I hide them, too?
Posted: Tue Jan 08, 2008 8:57 am
by narcis
Hi Dominik,
I'm afraid not. You could try setting the editor in tree mode or customizing your chart editor.
Posted: Tue Jan 08, 2008 9:10 am
by 9349911
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?
Posted: Tue Jan 08, 2008 10:07 am
by narcis
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;
Posted: Tue Jan 08, 2008 10:32 am
by 9349911
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 ?
Posted: Tue Jan 08, 2008 10:54 am
by 9349911
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.
Posted: Wed Jan 09, 2008 1:37 pm
by 9349911
Hi !
No idea what causes this problem ?
Posted: Mon Jan 14, 2008 12:16 pm
by Pep
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.
Posted: Fri Jan 18, 2008 11:04 am
by 9349911
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.
Posted: Sun Jan 20, 2008 6:52 pm
by 9047589
Hi, Pep and Dominik!
Isn't it simpler?
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.
Posted: Mon Jan 21, 2008 9:05 am
by 9349911
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 !
Posted: Mon Jan 21, 2008 7:46 pm
by 9047589
9349911 wrote:
your code is great and works perfect.
It is
n't mine, it's Steema's!
UTSL!!!