How to keep forms and frames compilable in Delphi 6 - 2007?
Asked Answered
P

3

7

We recently converted our long-running Delphi project to Open Source. Multiple people have contributed patches already, which is great, but unfortunately forms and frames when saved with Delphi 2006 (and later) contain new properties in the .dfm that are not handled by older versions. Forms are handled quite gracefully by the IDE ("ignore propery?"), but frames are loaded at runtime and result in errors. Not an option, as far as I'm concerned.

I now removed those properties from the .dmf files by hand, but I am really wondering if there is a more elegant solution. There is no way to save in a backwards compatible format from the new IDE's, is there? Are there existing tools to strip the nonsupported properties from the .dfm's ? Any other elegant solution I am missing?

Normally, with a commercial project, I'd just upgrade the project to the most recent version applicable... but as this is open source I really don't want to loose out on those developers still working on Delphi 7. That includes myself, actually.

Pointer answered 27/1, 2010 at 21:21 Comment(0)
S
12

The JEDI JVCL project uses a little utility dc.exe (delphi cleaner) and a list of properties in DFMs that are not present in older versions of delphi, mine contains the following text:

*.PopupMode
*.PopupParent
*.ExplicitLeft
*.ExplicitTop
*.ExplicitWidth
*.ExplicitHeight
*.BevelKind
*.BufferDocument
*.DoubleBuffered
*.ParentDoubleBuffered
*.DisableHyperlinks
*.AlwaysEnquoteFloats
*.PixelsPerInch

I run this dc.exe utility from a batch file which cleans my dfms before I commit changes to subversion. The syntax in my batch file for this is:

dc.exe -s -fd10.txt *.dfm -i

You can grab my stuff at:

http://sites.google.com/site/warrenpostma/files
Straticulate answered 27/1, 2010 at 21:57 Comment(1)
You type waaay too fast. <g> I was almost all the way through posting the same info; you beat me to it.Homes
N
5

You can try Andy's DFMCheck. It can automatically open and close all forms and frames in a project, which makes the IDE remove unknown properties (as Marco wrote).

Nickynico answered 28/1, 2010 at 7:37 Comment(0)
R
4

Well, for sake of completeness:

Open the dfms in the oldest Delphi supported, let it remove all unknown properties, change a property and save.

For your purposes, Warren's solution is better, but it can be a workaround. I did it for a while when we were dual D7-D2006ing.

Regicide answered 27/1, 2010 at 22:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.