I have a question about the correct usage of the "uses" clause.
Suppose I have a module using vcl.graphics. Now, I want to use this module in a Web Core application.
After having installed TMS Web Core, there are two folders: "TMS WEB Core RSXE13\Component Library Source" and "TMS WEB Core RSXE13\Core Source". Both contain a file "WebLib.Graphics.pas". The one in "TMS WEB Core RSXE13\Core Source" looks like a replacement of the vcl.graphics module.
My questions are:
-
When using a module containing "Vcl.graphics" in its uses clause, should I replace this uses by WebLib.Graphics or add the WebLib.Graphics to the uses clause? In the latter case, where: before or after Vcl.graphics?
-
What is the purpose of the modules in "TMS WEB Core RSXE13\Component Library Source"? When clicking a WebLib module in the uses clause, the IDE always jumps to these ones and not to the ones in "TMS WEB Core RSXE13\Core Source". This is confusing when an error message tells me a call to a method has its parameters are wrong or missing. Most of the time, those methods are missing in "TMS WEB Core RSXE13\Component Library Source". Maybe this is a Delphi IDE issue, but is there a way to change the search order?
- The folder "Component Library Source" contains just the components for design-time use. The code under "Core Source" is the framework code and is the code that is compiled for the application.
- The compiler will resolve the uses list Vcl.Graphics unit to WEBLib.Graphics automatically (and it is smart enough to ignore when WEBLib.Graphics would be used twice as a result of this).
Normally, the class definitions in source for design-time under "Component Library Source" should match the runtime class definitions. If you see differences, can you point to such differences as we would need to correct these.
This separation is caused by the limitation that the Delphi IDE has only 2 form designers, one for VCL and one for FMX.
Dear Sir,
Thank you for the clarification.
The biggest difference I saw so far is between the file WEBLib.Graphics in the folders "Component Library Source" and "Core Source":
- The one in the folder "Component Library Source” only contains constants and helper classes for TGraphic and Tcanvas. The methods in those helper classes are not documented.
e.g. procedure LoadFromURL(AURL: string; AHInstance: Integer); overload;
- The one in the folder "Core Source” contains a full definition of Tgraphic, including the methods documented in the manual.
Initially, I didn’t see the files in folder "Core Source” and I assumed the helper classes were referring to the definition in vcl.graphics. In that file, there are no definitions for the LoadFromURL methods, which was confusing at that time. Then I found the files in the “Core Source” and systematically replaced all vcl.-files by their corresponding WEBLib files. Amazingly enough, the IDE still inserts some vcl.-files (mainly Vcl.Controls, Vcl.StdCtrls and Vcl.Forms), but no longer vcl.graphics.
Kind regards,
Michel Huybrechts
Micriconsult BV
www.micriconsult.be
We will revise this but normally VCL.Graphics should be there at design-time and take care of auto-completion for TCanvas.