New forum category - DelphiForFun ? lazarus / 8-Other ---------------------------------------------------------------------- jmg · 2009-11-06 22:19 I'd like to suggest a new category, for supporting the DelphiForFun / Lazarus discussions. Perhaps under 'packages' ? There is a single thread for this now, but the DFF has 350+ Delphi projects that could/should be ported to Lazarus. I have done a couple, and done some 'rules', but they are not entirely consistent - so I expect good forum traffic, and I think this also needs to generate work on the Lazarus Project Import Wizard. web site  www.delphiforfun.com by Gary Darby Puzzles & Projects Beginners     Intermediate   Advanced     49                     89                73 Delphi Techniques    66 Math Topics   70 Utilities   10 ---------------------------------------------------------------------- Phil · 2009-11-07 01:13 Quote from: jmg on November 06, 2009, 11:19:55 pmThere is a single thread for this now, but the DFF has 350+ Delphi projects that could/should be ported to Lazarus. I would suggest you use MakePasX and DfmToLfm to batch convert all of these in one fell swoop. I imagine a fair number of them might be runnable out of the box, so to speak, without additional work. That's what those two console apps are for and that's how I typically use them to keep Delphi forms in sync with Lazarus. In any case, I would also suggest that you avoid the Lazarus import wizard completely. Using that you'll end up with two sets of code for each program, something that is completely unnecessary. Also, if you make the mistake of not turning off the manifest and not clearing the icon, Lazarus will generate its own .res file, writing over the Delphi one. You already have an icon in the .res file, so why let Laz generate a gigantic one by default? And the programs never used a manifest before so why do it now? In batching the conversion, it would be easy to automate the creation of the .lpi file too so you don't have to open each .dpr and select Application from the list. While this will add LCL to the dependencies automatically, you'll also want to turn on Delphi compatibility and other obvious things like range checking. Note that many of the conversion problems have little to do with getting the code to compile. For example, just take the CardProbability2 app: (1) ShellApi is Windows only, so you need a different approach. This has been discussed endlessly here so just search for it. It looks like ShellApi is only used for the link at the bottom. (2) The copyright symbol doesn't display on non-Windows platforms. A simple workaround is to put CP1252ToUTF8 around the string if it contains any upper-ASCII Ansi chars. Again, Unicode / UTF8 has been discussed a lot here. (3) The form size is a problem:  1457 x 947? That won't fit on a lot of laptop screens that are set at 1024 x 768. My MacBook is 1280 x 800 so it won't fit there either. Thanks. -Phil ---------------------------------------------------------------------- jmg · 2009-11-07 04:08 Quote from: Phil on November 07, 2009, 02:13:47 amNote that many of the conversion problems have little to do with getting the code to compile. For example, just take the CardProbability2 app: Correct, and I've  started a conversion template report, for this, where I log the steps, and record the Lazarus messages, and edits needed. In the early stages, getting a handle on that "How many problems are there ?" question is the first focus.   Thus far, I have what appears to be a graphics library issue on FourInARow, and so I took a couple more 'vanilla-graphics' projects and I got BouncingBall and Fibonacci Sunflowers working, with minimal effort The Fibonacci Sunflowers shows screen flickering, where delphi does not, so that might confirm graphics library issues ?