Using TeeChart Source code without installing to the IDE

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ACFTB
Newbie
Newbie
Posts: 2
Joined: Mon Nov 28, 2016 12:00 am

Using TeeChart Source code without installing to the IDE

Post by ACFTB » Wed Jan 11, 2017 11:02 am

I would like to use the TeeChart source code without installing it to the IDE.
I like to keep my IDE installations as "out-of-the-box" as possible. This means that it is not an option to install the binary and/or the source code to the IDE.
Until now I have done this by creating all components of other libraries (that can also be installed to the IDE) at run-time, and this worked well. With this, I can keep the source code of all libraries in our version control, so that if I need to change anything, these changes are also preserved. With TeeChart however I cannot get this to work.

As a test setup, I did the following:
  1. I have run the installer for the source code, so that it extracts the source code to disk. I did not run the recompile tool to add it to the IDE.
  2. I copied the source code folder to a different location and used the uninstaller to remove the original source code installation.
  3. I started a new Delphi VCL Forms project in the folder to which I copied the TeeChart sources (TeeChart sources are located in a subfolder)
  4. I added the TeeChart sources subfolder to the project search path
  5. I added the "Chart" unit to the uses section
  6. I put the following code in the FormCreate event handler:

    Code: Select all

    procedure TForm1.FormCreate(Sender: TObject);
    var
      lChart: TChart;
    begin
      lChart := TChart.Create(self);
      lChart.Parent := Self;
    end;
    
  7. When compiling the following errors appear:

    Code: Select all

    [dcc32 Error] TeCanvas.pas(5692): E2010 Incompatible types: 'VCLTee.TeCanvas.TTeeCanvas' and 'TeCanvas.TTeeCanvas'
    [dcc32 Error] TeCanvas.pas(8496): E2010 Incompatible types: 'TTeeCanvas' and 'TTeeCanvas3D'
    [dcc32 Fatal Error] TeeProcs.pas(662): F2063 Could not compile used unit 'TeCanvas.pas'
    
Now what I think is happening, is that in the TeCanvas unit there is the following in the implementation uses section:

Code: Select all

3099     {$IFDEF FMX}
3100     FMXTee.Html, FMXTee.Constants
3101     {$ELSE}
3102     {$IFDEF D16}
3103     VCLTee.TeeHtml, VCLTee.TeeConst
3104     {$ELSE}
3105     TeeHtml, TeeConst
3106     {$ENDIF}
3107     {$ENDIF}
Basically, when the compiler version is XE2 (D16) or higher, the VCLTee unit scope is added to the used units.
Now because I did not install the source code to the IDE, Delphi is using the shipped version of TeeChart Lite for all the units that carry the VCLTee prefix.

Is there an easy way to keep Delphi from thinking that it can use the Lite version for the VCLTee scoped units? Or can I make it so that the unscoped units are used throughout the Teechart source code?
Preferably I can do this with a simple compiler directive, so that it is portable beyond IDE settings (including to the command line compiler)
The unpreffered (and untested) alternative would probably be to remove these conditionals and only keep the unscoped unit names, and do this in all the source files. As this is a lot of work and makes upgrading to a new version in the future a lot harder, I would like to avoid solving it like this.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Using TeeChart Source code without installing to the IDE

Post by Yeray » Wed Jan 11, 2017 1:11 pm

Hello,

The first thing TeeRecompile does is to copy all the TeeChart sources to a new subfolder named "VCL", and it adds the "VCLTee" prefix to all the units (this is file names and the first line in the file contents). Next, these sources are compiled and installed into the selected IDEs.
These prefixed sources in the "VCL" folder are the ones that can be used in the search path.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ACFTB
Newbie
Newbie
Posts: 2
Joined: Mon Nov 28, 2016 12:00 am

Re: Using TeeChart Source code without installing to the IDE

Post by ACFTB » Wed Jan 11, 2017 2:57 pm

I ran TeeRecompile, and aborted as soon as it asked me to backup my existing TeeChart installation (shipped with Delphi).
I could then indeed point my sources directory to the newly created VCL directory and use the TeeChart sources instead of the Lite version of Delphi.
I also found I needed to add the VCLTee unit scope to my unit scopes list, or some units would not be found.

Thank you for your help!

Also if I may make a suggestion:
Make it so you have the option in TeeRecompile to only create the VCL/FMX directories with the correct unit scoping and stop there. This should be relatively easy to implement, and would make what I wanted to do possible without forcefully aborting the TeeRecompile process.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Using TeeChart Source code without installing to the IDE

Post by Yeray » Thu Jan 12, 2017 11:41 am

Hello,
ACFTB wrote:Also if I may make a suggestion:
Make it so you have the option in TeeRecompile to only create the VCL/FMX directories with the correct unit scoping and stop there. This should be relatively easy to implement, and would make what I wanted to do possible without forcefully aborting the TeeRecompile process.
We'll add a new parameters for TeeRecompile:

Code: Select all

-generateunits:XX
where XX is the number of the IDE. Ie:

Code: Select all

TeeRecompile.exe -generateunits:24
See the WhatsNew for a list of the supported parameters introduced in TeeRecompile with TeeChart v2014.11.140512.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply