These are my steps converting your Delphi project to cross-platform Lazarus. I am beginning on Windows because I can have a look at the project in Delphi here. I am doing the conversion manually because I have more control over what is happening this way.
Wow...you did a lot. Presumably this is what Lazarus does when it converts a project.
- Edited each pas file in Notepad++ and removed the namespace from the unitnames in the uses clauses (i.e. WinApi.Windows --> Windows, etc. }
I've done that bit too...Lazarus had commented out all those units, so I uncommented and removed the namespaces, then removed the duplicates. I think I also removed the Windows unit.
- Next compilation attempt: "Duplicate identifier "Disc"" in unit DiscImage. OK, there is a property Disc with the same name as this local variable; mode ObjFPC does not accept this. To fix this and all other issues of this kind I opened the project options > "Compiler options" > "Parsing" and selected "Delphi (-MDelphi)" in the "Syntax mode" combo box.
In my process to migrate it away from being MDelphi, I found the same error. Initially I changed the identifier name to "Disk", before I realised I had been stupid originally and could have just used "Result", and remove the identifier declaration completely.
- next: "Identifier not found "TDirectory"", in line TDirectory.CreateDirectory(path+windowsfilename)... I don't know of a class TDirectory in Lazarus, maybe a consequence of the removed IOUtils unit. I decided to use the plain old CreateDir and replace TDirectoryCreateDirectory(..) by it - this probably will work.
TDirectory is defined in the DiscImage unit. It is my own definition.
- The three edit boxes are not read-only, even after unchecking the "LCLScaling" and "Use manifest" checkboxes. So, I don't know what you did wrong...
I don't know either. It's an odd one. But thank you for doing all that. I've learnt a lot from that - thank you.
I'll go back over my code, because I'm sure there are still some of those units in it that you have removed.
Another oddity (and I know this is going off topic) I've found is with the function:
function TMainForm.IntToStrComma(size: Int64): String;
begin
Result:=Format('%.0n',[Real(size)]);
end;
With {$MODE MDelphi} it returns 0, no matter what 'size' is set to (bearing in mind this works on Delphi). But change to {$MODE objFPC} and it works fine - returns a number (as a string) with thousands separators.