<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Juha,<br><br>I compiled ess-model from your git repo on win32.<br>Had to add 3 TODO's to make it compilable for win32.<br><br>Tried to commit the changes to your git-repo.<br>It was the first time I used git and it looks like my user-settings were not very good.<br>The name used to commit was "master". I have changed my settings so next time it should be better.<br><br>That's it for the moment. Will play around with the sources as soon as I have some spare time.<br><br>Thank you very much for your incredible work you did for the DelphiToLazarus Convertion stuff !!!!<br><br>Regards,<br><br>Sam<br><br><br>--- Juha Manninen <i><juha.manninen@phnet.fi></i> schrieb am <b>Mo, 3.5.2010:<br></b><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><b><br>Von: Juha Manninen <juha.manninen@phnet.fi><br>Betreff:
[Lazarus] Challenge of converting a Delphi project<br>An: lazarus@lists.lazarus.freepascal.org<br>Datum: Montag, 3. Mai, 2010 13:52 Uhr<br><br></b><div class="plainMail"><b>Hi<br><br>I have been converting EssModel Delphi program, partly as an exercise and <br>partly because it could develop into a useful program or component.<br>It is a reverse engineering class diagram tool.<br><br>I am facing more problems than expected. This is not related to Delphi <br>converter in Lazarus but to the manual editing after it.<br><br>First, the code uses a trick. It typecast controls like TForm to a local <br>TCrackControl just to reach the protected TControl.OnMouseDown and such.<br><br> type<br> TCrackControl = class(TControl); // <-- empty local class<br> var<br> found: TControl;<br> cc: TCrackControl;<br><br>and later:<br> // 'found' can be TForm or anything.<br>
cc:=TCrackControl(found); // <-- error<br> cc.OnMouseDown := ...<br><br>It gives 'RunError(219)', and the whole Lazarus may become unstable.<br>The typecast is actually OK because the controls inherit from TControl and <br>OnMouseDown is defined there. According to Mattias this system is even used in <br>Lazarus itself. In a small test project the same system worked for me, too.<br>???<br><br>The program used interfaces heavily, actually in a clever way. I thought they <br>cause the above problem and changed the code quite much to get rid of <br>interfaces. No difference, it still doesn't work.<br><br>Next problem: I noticed there are TActions defined in a DataModule which is <br>created in MainForm.OnActivate handler, and the actions are used in form's <br>menu and button. I thought it causes problems and I copied everything from <br>DataModule to MainForm. I set the actions carefully like they were before and <br>now menu items work but
open-button does not. The exact same action is <br>triggered by menuitem but not by button!<br>So, this refactoring didn't solve any problems but created a new one.<br><br>And then: before the program closes it writes recent files to registry. It <br>gives an error when writing a string, although I can find the "reg.xml" file <br>it wrote. The same thing works in my small test project without errors.<br><br>All the program's behavior is defined in project file, pascal source code and <br>form files. Am I correct?<br>So, WHAT CAN CAUSE SUCH PROBLEMS? I have used many many hours already trying <br>to solve this.<br>The program itself is not very important now, I could as well forget it.<br>I just feel uncomfortable when there are errors which I can't explain.<br>Besides I am supposed to improve Delphi converter but now I am not even able <br>to convert a program myself...<br><br>My tests happened on Linux, with GTK2 and QT. If someone likes to look at the
<br>code, please do this:<br><br> $ git clone git://github.com/JuhaManninen/Pascal.git<br><br>It is not big.<br>At least it should be easy to verify the MainForm.OpenButton doesn't work <br>while it should, even though the program hasn't done anything yet.<br><br><br>Regards,<br>Juha<br><br>--<br>_______________________________________________<br>Lazarus mailing list<br><a ymailto="mailto:Lazarus@lists.lazarus.freepascal.org" href="/mc/compose?to=Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br><a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br></b></div></blockquote></td></tr></table><br>