Jump to content
jarto

Request for feedback: Changing class names in the RTL

Recommended Posts

As you all know, almost all classes in Smart Mobile Studio are named TW3Something. For example: TW3Button, TW3Panel etc. The decision to do that was done during the first stages of development of Smart Mobile Studio. However, there's no technical reason why the "W3" has to be there. So basically, we could rename all the components and classes to be more compatible with Delphi and making code sharing and porting easier.

I wrote a program yesterday evening that analyzed and renamed all the classes and records that start with TW3 in the RTL. There are 849 of them to be precise. The app also renamed themes and the IDE code, so that I was able to compile a new IDE and make my first app with TForm and TButton etc. It all worked nicely, except that the chart component is causing a bit of trouble. It's using TPanel and a couple of other classes that would cause conflicts.

I'd be able to add remapping functions to the IDE so that you could load an old project and all the TW3Whatever-classes would be converted to TWhatever. But if you have your own components using names like TPanel, TButton, TList, TStringList, they would cause trouble. Question is: Do you have them and how much of code like this do you have?

Any thoughts?

Share this post


Link to post
Share on other sites

If it was possible to not break existing code then I would not be against it. I don't convert much delphi code so I don't see it as important from that point of view. It might make it more delphi friendly perhaps, making transition easier for people.

 

I think what catches out more delphi users is that expected properties of components aren't there, something as simple as changing the form colour is not obvious. The paradigm shift is quite steep if you aren't used to working with CSS and HTML etc (which I am not) so it takes a little bit of adjustment.

Share this post


Link to post
Share on other sites
10 hours ago, Czar said:

I think what catches out more delphi users is that expected properties of components aren't there, something as simple as changing the form colour is not obvious. The paradigm shift is quite steep if you aren't used to working with CSS and HTML etc (which I am not) so it takes a little bit of adjustment.

This. ^^^^^

That said, I vote for the change.

-David

Share this post


Link to post
Share on other sites

I don't see much of an advantage to be honest.

If the ide is changed to allow both versions, then that negates any code problems of course. 

There is however also documentation (Primoz book) and search to consider.

Personally I don't use TButton etc (as that was your question). 

Share this post


Link to post
Share on other sites

I also do not see much of point in W3 prefix, perhaps idea was to distinguish it from Delphi classes.

Anyway if works I would add simple mapping from old to new directly in affected units without doing anything to IDE.

Something like TW3Button = TButton or class(TButton)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×