[Lazarus] Delphi converter improvements
Juha Manninen
juha.manninen at phnet.fi
Sat Feb 6 22:17:45 CET 2010
> * The first is the usual dialog where converter inform us that some
> properties are invalid and offer us to remove them. But this dialog needs
> some improvement for example when there is a component on form resource that
> is unknown, such as the case of for example TRichedit, maybe because it's
> provided by an user package or maybe the user wants to swap such class for a
> TMemo and then retry again to remove new invalid properties, etc.
Right. The dialog is used also for checking existing .lfm files. I think the
same improvements would help there, too.
I started to collect a list of fallback components for some Delphi components.
Now it has 3 items:
TRichedit -> TMemo
TValueListEditor -> ???
TCoolbar -> TPanel
When testing the big 3-D program Deled I got lots of errors while the
converter was reading the form stream. Here are some screenshots of them.
What could be the reason? Is it some new Delphi format?
http://koti.phnet.fi/juhamann/Lazarus/ReadError1.jpg
http://koti.phnet.fi/juhamann/Lazarus/ReadError3.jpg
http://koti.phnet.fi/juhamann/Lazarus/ReadError5.jpg
http://koti.phnet.fi/juhamann/Lazarus/ReadError6.jpg
http://koti.phnet.fi/juhamann/Lazarus/ReadError7.jpg
http://koti.phnet.fi/juhamann/Lazarus/ReadError8.jpg
Non-existent properties don't cause such read errors but the "normal" dialog:
http://koti.phnet.fi/juhamann/Lazarus/FixLfmDialog.jpg
Interesting note: when I converted this big project using GTK2 build of
Lazarus, it finally died for invalid floating point operation, about like with
the qtcurve theme library earlier. QT build of Lazarus worked fine (no crash).
> * A dialog pops that some units are not found: dnssend, smtpsend, synautil,
> synamisc. It offer us to remove or comment them. I would be happy if: (the
> best) it makes an effort to find the best package (known by lazarus at that
> time) that provides these units and offer a list if find more than one and
> then add the requirement to converted project, or (the worst) it could ask
> where to find such units and add them to source path.
Yes. It should be more automatic.
> * There is no main form visible (a no forms in forms list) although
> unit1.pas was added to project inspector. Doubleclicking the unit1.pas node
> in project inspector showed the form and form1 now appears in forms list.
I fixed it and copied changes into the github repo. I also did a major
refactoring to the converter code. Now it is more object oriented. Earlier
there were only functions, 1980's style pascal ... :-)
> * saved the project and compiled. It failed with this: Error: Can't open
> resource file
> "/home/prog/work/synapse/39/source/demo/MailCheck/MailCheck.RES", .RES?, I
> looked into project source and found {$R *.RES}, simply changed *.RES to
> *.res and this time it compiled fine.
Right. Could it be located and changed easily with codetools? Dunno...
> did it run? yes. did it work? no, at least no here in linux x86_64 but that
> is another matter :)
Fully automatic conversion will not happen, except for some trivial programs.
Juha Manninen
More information about the Lazarus
mailing list