Hi:
.dfm shows DefaultCanvas := 'TGDIPlusCanvas';
TChart has no such property as DefaultCanvas but only a DelphiCanvas.
Why doesn't this pop up an error?
Thanks
dfm Property
Re: dfm Property
Hello,
There's a private property in TCustomTeePanel named IDefaultCanvas. And at TCustomTeePanel.Create constructor you'll find this to use the value from the registry:
Then, to read the DefaultCanvas property from the dfm we use this:
I hope this explains your doubt.
There's a private property in TCustomTeePanel named IDefaultCanvas. And at TCustomTeePanel.Create constructor you'll find this to use the value from the registry:
Code: Select all
Constructor TCustomTeePanel.Create(AOwner: TComponent);
begin
inherited;
//...
// For new charts, set default canvas whatever is at the Registry,
// or use the class indicated by TeeDefaultCanvas global variable,
// which is (in VCL) the GDI+ canvas by default.
// Setting TeeDefaultCanvas:='' will not look at registry, and will not
// use VCL GDI+
if (TeeDefaultCanvas<>'') and
(not (csLoading in ComponentState)) then
IDefaultCanvas:=TeeReadStringOption('DefaultCanvas',TeeDefaultCanvas)
else
IDefaultCanvas:=''; // Existing old charts saved in dfm/fmx, no change
CreateDefaultCanvas;
//...
end;
Code: Select all
Procedure TCustomTeePanel.DefineProperties(Filer:TFiler);
function DoWriteDefaultCanvas:Boolean;
begin
result:=(Filer.Ancestor=nil) or
(IDefaultCanvas<>TCustomTeePanel(Filer.Ancestor).IDefaultCanvas);
end;
begin
inherited;
//...
Filer.DefineProperty('DefaultCanvas',ReadDefaultCanvas,WriteDefaultCanvas,
{$IFDEF FMX}False{$ELSE}DoWriteDefaultCanvas{$ENDIF});
end;
procedure TCustomTeePanel.ReadDefaultCanvas(Reader: TReader);
begin
IDefaultCanvas:=Reader.ReadString;
{$IFDEF FMX}
IDefaultCanvas:=''; // Switching canvas is not supported yet in FireMonkey
{$ENDIF}
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |