class name pre-processing clarification

Hello,

I may have missed the documentation that clarifies this, but it's not very clear (in my opinion) to understand how unit names and class names are pre-processed.

Are the class names changed from TWebSomething to TSomething (except if there is a {NOPP} directive) for all the files, or only all files excluding those located in the TMS Web Library path ?

does the inheritance of a class has to be the same between runtime and designtime ?
If I look to the TWebPanel, for instance, comparing the sources files from 'Component Library Source' and 'Core Source'

at design time :

TObject > TPersistent > TComponent > TControl > TWinControl > TCustomControl > TWebCustomControl > TWebCustomPanel > TWebPanel

at runtime :

TObject > TPersistent > TComponent > TControl > TWinControl > TCustomControl >
TWebCustomControl > TCustomPanel > TPanel > TWebPanel
(I can't see any TWebCustomControl class definition in 'Core Source')

So if y write a TWebToggle and register it in the IDE, should I declare it in the runtime source as TToggle ?

Also when I declare this at design time

TWebToggle = class(TWebCustomPanel);

and at runtime

TToggle = class(TCustomPanel);

The compilation is fine but the IDE underlines TCustomPanel and says Undeclared Identifier. ..Should I include the runtime library in the IDE library path ?

Any advices of good practice for writing custom controls for Web platform are welcome

thanks.

TWebClassname is preprocessed to TClassname. Reason here is that we couldn't re-register already existing classnames in the IDE (IDE limitation).
Class hierarchy is not always strictly the same between design-time and run-time, especially when existing VCL classes are used for the design-time where the VCL imposes a class hierarchy that is not suitable for the TMS WEB Core framework.
Main goal is to make the IDE editor work as expected wrt code completion / code insight.

1 Like